Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- int a;
- int b= 0 ;
- cout << "Vedite chislo a ot 0 do 500 \n";
- cin >> a;
- if (a >= 500) a = 499;
- for (int i = a; i < 501; i++)
- {
- b += i;
- }
- cout << b;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement