Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. int main(int argc, char *argv[]){
  6. cout<<" having "<<argc<<" parameters !";
  7. int sum=0;
  8. for(int i=1;i<=argc;i++){
  9. if(argv[i]!=NULL){
  10. int term=stoi(argv[i]);
  11. sum+=term;
  12. }
  13. }
  14. cout<<endl<<" Suma = "<<sum;
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement