Loading

洛谷 P2788数学1(math1)- 加减算式 题解

题目传送门

这道题目可以使用C++的神奇功能:

#include<bits/stdc++.h>
using namespace std;
int ans,t;
int main(){
    while(cin>>t) ans+=t;
    printf("%d\n",ans);return 0;
}

 

没错!就是这么简单!

 

posted @ 2018-05-02 20:59  yzx_1798106406  阅读(256)  评论(0编辑  收藏  举报