Pagini recente » Cod sursa (job #2967224) | Cod sursa (job #2965426) | Cod sursa (job #2696430) | Cod sursa (job #435708) | Cod sursa (job #709341)
Cod sursa(job #709341)
#include <iostream>
#include <string>
#include <fstream>
#include <math.h>
using namespace std;
int main(){
ifstream fin("text.in");
ofstream fout("text.out");
string s;
getline(fin,s);
int charszam=0,szoszam=0;
bool ok=false;
for (int i=0;i<s.length();i++){
if((s[i]>='a')&&(s[i]<='z')||(s[i]>='A')&&(s[i]<='Z')){
charszam++;
ok=true;
}else if(ok){
szoszam++;
ok=false;
}
}
double x=charszam/szoszam;
cout<<charszam<<" "<<szoszam<<endl;
fout<<floor (x);
fout.close();
}