就比如说要输入多组数据,每行一组,进行加法,输出的时候每行输出一个。

用C++写:

#include <iostream>
using namespace std;
int a,b;
while(cin>>a>>b)
{
cout<<a+b<<endl;
}
用C写:

#include <stdio.h>

int a,b;
while(scanf("%d%d",&a,&b)!=EOF)
{
printf("%d+%d\n",a+b);
}


友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信