C++程序:数字和
C++程序:数字和Input:输入数据中包含了不多于50个的正整数n。 Output:每个整数都应输出一个各位数字和,并独占一行。 Sample Input:123455612382Sample Output:151710
其他答案
代码如下:#include<iostream>using namespace std;void main() { char a[50];int n=0;long i=0;cout<<"请输入整数(长度不能大于50):";memset(a,0,50);cin>>a;while(int(a[n])>0 && n<50 展开
2011-01-18 10:12
来自北京市
赞(0)点赞赞(0)举报
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。




