Pagini recente » Diferente pentru utilizator/razvanpg intre reviziile 1 si 2 | Cod sursa (job #2820350) | Cod sursa (job #2809777) | Cod sursa (job #1698590) | Cod sursa (job #1766678)
#include <string.h>
#include <fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int suma, i;
char meh[255];
int main()
{
while(in >> meh)
{
suma+= strlen(meh);
i = strlen(meh);
for(int j = 0; j < i; ++j)
{
if(meh[j] == ',' ||
meh[j] == '!' ||
meh[j] == '?' ||
meh[j] == '-' ||
meh[j] == '.' ||
meh[j] == ':' ||
meh[j] == '"' ||
meh[j] == '`')
{
--suma;
}
}
}
out << suma;
}