Cod sursa(job #2922922)
Utilizator | Data | 10 septembrie 2022 17:12:32 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in ("text.in");
ofstream out("text.out");
int main(){
char ch;
bool cuv=false;
int nrc=0,nrch=0;
while(in>>noskipws>>ch){
if(ch>='a' && ch<='z' || ch>='A' && ch<='Z'){
if(cuv==true){
nrch++;
}
else{
cuv=true;
nrch++;
nrc++;
}
}
else{
cuv=false;
}
}
out<<nrch/nrc;
}