Task: | Loops |
Sender: | jeroenrobben |
Submission time: | 2018-09-12 23:51:38 +0300 |
Language: | C++ |
Status: | COMPILE ERROR |
Compiler report
input/code.cpp:5:20: error: two or more data types in declaration of 'solve' int int solve(int n) { ^ input/code.cpp: In function 'int main()': input/code.cpp:17:13: error: 'solve' was not declared in this scope cout << solve(i); ^~~~~
Code
#include <iostream> using namespace std; int int solve(int n) { int int x = 0; for (int a = 1; a <= n; a++) for (int b = a; b <= n; b++) for (int c = a; c <= b; c++) x++; return x; } int main() { int i; cin >> i; cout << solve(i); }