|
|
back to boardDiscussion of Problem 1068. SumVisual C++ Accepted Posted by mNT 19 Jun 2018 15:47 #include <iostream> using namespace std; int main() { int n; int c = 0; cin >> n; if (n>0) { for (int i = 1; i <= n; i++) c += i; cout << c; } else if (n <= 0) { for (int i = n; i <= 1; i++) c += i; cout << c; } return 0; } Re: Visual C++ Accepted Posted by Orient 20 Jun 2018 11:56 Now do it in 0.001 Re: Visual C++ Accepted Posted by mNT 20 Jun 2018 16:00 Mmm... What?) Edited by author 20.06.2018 16:02 |
|
|