Cod sursa(job #2780707)

Utilizator DanJDan Junior DanJ Data 7 octombrie 2021 18:52:12
Problema Text Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <iostream>
#include <fstream>
#include <string.h>

using namespace std;

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

char A[100];
int l, med, c;

int main(){

fin.get(A, 100);

l = strlen(A);

for (int i = 0; i < l; i++){

    if (A[i] == ' ') c++;

}

med = l / c;

fout << med;

return 0;

}