题解 | 多组_A+B_EOF形式

多组_A+B_EOF形式

https://www.nowcoder.com/practice/295063bf1bce4c2e819a8f18a5efcd20

#include <iostream>
#include <sstream>
#include <string>
using namespace std;

int main() {
    string line;
    while (getline(cin,line)) {
        istringstream iss(line);
        int a,b;
        if(iss >> a >> b){
            cout << a +b << endl;
        }
    }
}

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务