#include注意:memset的使用方法,memset(赋值对象,赋值。对象size)#include using namespace std;int main(){ char m[4],n[4]; cin>>m>>n; int temp[4]; while(m[0]!='0'&&n[0]!='0') { int N=0; memset(temp,0,sizeof(temp)); for(int i=2;i>=0;i--) { temp[i]=temp[i]+m[i]+n[i]-'0'-'0'; if(temp[i]>9) { N++; if(i>=1) temp[i-1]+=1; } } cout< < >m>>n; }}
size非常重要啊。