Pagini recente » Atasamentele paginii Expresii 3 | Cod sursa (job #2757020) | Borderou de evaluare (job #3212381) | Cod sursa (job #2822718) | Cod sursa (job #1061331)
#include<stdio.h>
#include<stdlib.h>
using namespace std;
char c; int q,cuv,flag=1;
int main()
{
FILE*f=fopen("text.in","r"); FILE*h=fopen("text.out","w");
while(!feof(f))
{
fscanf(f,"%c",&c);
if((c>95&&c<123)||(c<91&&66<c))
{
q++;
flag=1;
}
else
if((c==32||c==45)&&flag==1)
{
cuv++;
flag=0;
}
}
printf("%i %i",q,cuv);
fclose(f); fclose(h);
return 0;
}