Problem in the input

+1 Mahmoud Abdel Ghani · June 10, 2015
hey.. i solved this problem but there is one problem that when i enter 4 numbers together how can i put in the array every digit..here is the problem and my solution: 
https://uva.onlinejudge.org/index.php?option=onlinejudge&Itemid=99999999&page=show_problem&category=&problem=2843&mosmsg=Submission+received+with+ID+15610713

and my solution:
http://pastie.org/10234042

Post a Reply

Replies

Oldest  Newest  Rating
0 Anton Wieslander · June 11, 2015
Hey there,


I would store the 4 digit number as a string. (You could make it work with all 16 digits as well)
then you can use string functions to look at each digit separately.
pass a digit to a function to convert that digit to int and then store it in the array.

Hope this helps.
  • 1

C++

107,190 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator