Luogu P2788 Math 1 (math1) - Addition and Subtraction Problem Solutions

topic portal

This problem can use the magic of C++:

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

 

That's right! It's that simple!

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325178079&siteId=291194637