0

Can you kindly explain this?

https://code.sololearn.com/cbVyZnxD3evw/?ref=app input <= 45g65 output => 4565 input <= 45gjsb65 output => 450 input <= 45 output => 450 Suppose, I just want to remove any number of character inside a digit, where to make change? And why it puts 0 if I enter 45hvsg65 or 45, why not 4500?

22nd Jun 2021, 3:54 AM
Lucifer Samael Morningstar
7 Respuestas
+ 2
I don't think you can use scanf placeholder format argument to achieve more than skipping a fixed number of char before getting another number... you rather have to get the whole line input as string and extract numbers from it by yourself ^^
22nd Jun 2021, 5:53 AM
visph
visph - avatar
+ 2
Lucifer Samael Morningstar As visph said ,get input as string then scan the string ,check if any isalpha(c) there, if yes remove it or print only if isnum(c) is there
22nd Jun 2021, 6:25 AM
saurabh
saurabh - avatar
+ 1
Bro what's ur requirement, Is it to remove all characters from the input, o/p should have only number???? Like 45gjsjs78>>>>4578 6hsh8vab0bsb233>>>680233
22nd Jun 2021, 5:52 AM
saurabh
saurabh - avatar
0
Hêłp☆mę!Č++🥺 Yes but what do you mean by o/p?
22nd Jun 2021, 5:57 AM
Lucifer Samael Morningstar
0
o/p means Output
22nd Jun 2021, 6:22 AM
saurabh
saurabh - avatar
0
yeah o/p should have only number
22nd Jun 2021, 6:25 AM
Lucifer Samael Morningstar
0
Hêłp☆mę!Č++🥺 okay got it thanks
22nd Jun 2021, 6:26 AM
Lucifer Samael Morningstar