不知所云的江


私信TA

用户名:yehongjiangcpp

访问量:7080

签 名:

select * from student;

等  级
排  名 868
经  验 3442
参赛次数 0
文章发表 10
年  龄 0
在职情况 学生
学  校 School Of Caliton
专  业

  自我简介:

select * from student;

解题思路:

注意事项:

参考代码:

#include <iostream>
#include <string>
using namespace std;

int main() {
	string a ,b;
	cin>>a>>b;
	int num = a.length()+b.length();
	int *array = new int[num]();
	int temp = 1;
	for(int i=a.length()-1; i>=0; i--,temp++) {
		for(int j=b.length()-1,k=num-temp; j>=0; j--,k--) {
			array[k] += (a[i]-'0') * (b[j]-'0');
		}
	}
	temp = 0;
	for(int i=num-1; i>=0; i--) {
		array[i] += temp;
		temp = array[i] / 10;
		array[i] %= 10;
	}
	if(array[0]!=0) cout<<array[0];
	for(int i=1;i<num;i++) cout<<array[i];
	return 0;
}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区