+ 5
[SOLVED] Please tell me what's wrong with this code?
#include <stdio.h> int main() { int dollars, pesos; scanf("%d",&pesos); scanf("%d",&dollars); if(dollars*50 > pesos) { printf("Pesos"); } else { printf("Dollars"); } return 0; } All time it shows me fail in last test case.
4 ответов
+ 4
May be its a skee-ball Challenge mention problem also it will be better for community to understood your question. you need little change in if condition
if( points /50<cost)
Replace with / in instead of multiplication operator.
+ 3
I use this:
if (a / 50 > b)
a is pesos, b = dollars.
+ 2
You can take value float not int
Like-:
float dollars ,pesos;
+ 1
Keep scanf stmt below printf stmt