Cod sursa(job #2324053)

Utilizator StefanZamfirStefan Zamfir StefanZamfir Data 20 ianuarie 2019 11:11:10
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 1.06 kb
#include <iostream>
#include <queue>
#include <stack>
#include <map>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <set>
#include <algorithm>
#include <bitset>
#include <time.h>
#include <tuple>
#include <fstream>
#include <iomanip>
#include <utility>

#pragma warning "da 100% din tine. :)"
#define nl '\n'
#define sp ' '
#define pb(x) push_back(x)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SIZE 3000
#define NR 105
#define N 11
#define INF 10000

using namespace std;

int main() {
    freopen("text.in", "r", stdin);
    freopen("text.out", "w", stdout);
    ios_base::sync_with_stdio(false);
//    clock_t tStart = clock();
    int nrchar = 0;
    int nrcuv = 0;
    int crchar = 0;
    char ch;
    while(cin.get(ch)){
        if(isalpha(ch)){
            if(crchar == 0)
                ++nrcuv;
            ++nrchar;
            crchar = 1;
        }
        else{
            crchar = 0;
        }
    }
    cout << nrchar/nrcuv;
    return 0;
//    printf("\nTime taken: %.2fs\n", (double) (clock() - tStart) / CLOCKS_PER_SEC);
}