标签:article cpp 重要 使用 for stream nbsp str main
#include<iostream> #include<memory.h> 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<<N<<endl; cin>>m>>n; } }
size非常重要啊。
标签:article cpp 重要 使用 for stream nbsp str main
原文地址:http://www.cnblogs.com/gccbuaa/p/6823244.html