解题思路:
注意事项:
参考代码:
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int a,b,c;
while (cin>>a)
{
c=a;
if(a==0) break;
else
while (cin>>b)
if(b!=a)
c=c+b;
else {cout<<c<<endl;break;}
}
return 0;
}
0.0分
0 人评分
多输入输出练习1 (C语言代码)浏览:1181 |
大小写转换 (C语言代码)浏览:846 |
计算质因子 (C++代码)浏览:1624 |
【偶数求和】 (C语言代码)浏览:640 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:449 |
水仙花 (C语言代码)浏览:1048 |
IP判断 (C语言代码)浏览:533 |
企业奖金发放 (C语言代码)浏览:2317 |
格式化数据输出 (C语言代码)浏览:815 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:530 |