ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.
გაგზავნის თარიღი: 22.01.2023 10:48:25
ამოცანა: რიცხვითი ბანქო
მომხმარებელი: saba2012
ვერდიქტი: ამოუხსნელი
შეფასება: 0 ქულა
#include <iostream> using namespace std; int a, b, c , d , n; main () { cin >> n; for (int i = 0 i < n; i++) { cin >> a >> b; if (a > b) c = c + a + b; else if d = d + b + a; else { c = c + a; d = d + a; } } cout << c << " " << d; }
main.cpp: In function 'int main()': main.cpp:11:20: error: expected ';' before 'i' for (int i = 0 i < n; i++) ^ main.cpp:18:16: error: expected '(' before 'd' d = d + b + a; ^ main.cpp:19:13: error: 'else' without a previous 'if' else ^~~~