|
|
back to boardDiscussion of Problem 1068. SumРешение C++ | Solution C++ Posted by Viktor 4 Apr 2017 04:38 #include <iostream> using namespace std; int main(){ int n, i = 0; cin >> n; while (n != 1){ if (n <= 1){ i+= n; n++; } else if (n >= 1){ i+= n; n--; } } cout << i+1; return 0; } Re: Решение C++ | Solution C++ |
|
|