CSES - Datatähti 2023 alku - Results
Submission details
Task:Kertoma
Sender:Turhake
Submission time:2022-11-07 14:23:51 +0200
Language:C++ (C++11)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:32:21: error: expected primary-expression before '}' token
   32 |                     }
      |                     ^

Code

#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for(int i=a; i<=b; i++)
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int luvut[9], s=0, loppu=0;
    float n=2, summa=0;
    REP(i, 0, 9)
    {
        cin>>luvut[i];
        s=s+luvut[i];
    }
    switch(s)
    {
        case 1: if(luvut[6]==1)
                    cout<<3;
                else
                    cout<<2;
                break;
        case 3: if(luvut[1]==1)
                    cout<<5;
                else
                    cout<<6;
                break;
        default: while(loppu==0)
                    {
                        summa=summa+log10(n);
                        n++;
                        if(loppu==1)
                    }
                    cout<<n-1;
                break;
    }
}