scanf(%s,arr)" produces WA, while cin >> arr produces AC

Revision en1, by shyam1909, 2021-09-23 07:57:19

I was solving this problem problem .I encountered a problem while inputting the string . In my first submission i used scanf("%s",arr) which resulted in WA. Then i changed the input method to cin >> arr , then the submission became AC. Submission using scanf -> scanf Submission using cin -> cin

Submission using scanf() worked fine in my pc, but not in codeforces.

Can someone help me why does scanf() doesn't work here? Thanks in advance :)

Tags doubt

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English shyam1909 2021-09-23 07:57:19 701 Initial revision (published)