[Wrong Soluton Accepted] Problem 118A

Revision en1, by NeekT, 2021-02-09 23:26:13

I was attempting problem 118A (https://codeforces.com/problemset/problem/118/A) and I got it wrong the first time. I'd like some help to figure out what went awry (my submission: https://codeforces.com/contest/118/submission/107014817) but my major issue is another one. I was looking at some other solutions to get clues about my own mistakes, and I found this submission as an accepted answer:

#include<stdio.h>
#include<string.h>
main()
{
char a[101];int i;
gets(a);
strlwr(a);
for(i=0;a[i]!='\0';i++)
{if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u'||a[i]=='y')
;else
printf(".%c",a[i]);}
}

The instructions for the problem are quite clear: "The program's input is exactly one string, it should return the output as a single string," but in this solution the answer is not a single string. A single string should be printed out with something like "%s",string. What am I missing here?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English NeekT 2021-02-09 23:26:13 967 Initial revision (published)