Cod sursă (job #692018)

Utilizator avatar thvulpe Theodor Vulpe thvulpe IP ascuns
Problemă Lanterna Compilator cpp-32 | 0,38 kb
Rundă cex_11_12_30_ian_2023 Status evaluat
Dată 1 feb. 2023 20:05:06 Scor 0
#include <iostream>
#include <fstream>
#include <algorithm>
#include <stack>

using namespace std;

ifstream fin("lanterna.in");
ofstream fout("lanterna.out");

int n, t[100003], tot, k;

int main(){
    fin >> n;
    for(int i = 1; i <= n; i++)
        fin >> t[i];
    while(k <= n){
        tot += t[2] + t[1];
        k++;
    }
    fout << tot;
    return 0;
}