Pagini recente » Cod sursa (job #2854652) | Cod sursa (job #1032129) | Cod sursa (job #1685526) | Cod sursa (job #347656) | Cod sursa (job #855643)
Cod sursa(job #855643)
#include<fstream>
using namespace std;
char x=' ',y='\0',z='\0';
int t_c,t_cuv;
int main(){
ifstream f("text.in");
while(f.good()){
x=f.get();
if(y=='\0'&&z=='\0')
y=x;
else {
z=y;
y=x;
}
if(strchr("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",y))
t_c++;
else if(strchr("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",y)==0&&strchr("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",z)&&z!='\0')
t_cuv++;
}
f.close();
ofstream g("text.out");
g<<t_c/t_cuv;
g.close();
return 0;
}