Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <iostream>
- #include <cstdlib>
- using std::cout;
- using std::endl;
- int main(int argc, char **argv)
- {
- double sum=0;
- if(argc > 1)
- {
- for(int i = 1; i < argc; i++)
- sum+= atof(argv[i]);
- cout<< "Sum is " << sum << endl;
- } else {
- cout<< "No numbers" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement