解题思路:
注意事项:
参考代码:
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int a,s,b;
while(cin>>a)
{s=a;
while (cin>>b)
{if(b==a) {cout<<s<<endl;break;}
else s=s+b;}}
return 0;
}
0.0分
0 人评分
点我有惊喜!你懂得!浏览:1393 |
2004年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:682 |
【回文数(二)】 (C语言代码)浏览:853 |
C语言训练-列出最简真分数序列* (C语言代码)浏览:505 |
C语言训练-求函数值 (C语言代码)浏览:931 |
【绝对值排序】 (C++代码)浏览:672 |
多输入输出练习1 (C语言代码)浏览:1181 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:667 |
回文数(一) (C语言代码)浏览:731 |
C语言训练-求PI* (C语言代码)浏览:614 |