题目:https://pintia.cn/problem-sets/994805260223102976/problems/1038429065476579328
经验总结:
注意这里面不能输出前导零,即100*100,只能输出1。。。有两个测试点就卡在这,为什么要去掉前导零呢?
C++代码:
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int multiply = a*b;
bool flag = false; //标记前导零是否输出完了。
while(multiply>0){
if(multiply%10 != 0||flag){
cout<<multiply%10;
flag = true;
}
multiply /= 10;
}
return 0;
}