..
四舍五入
http://www.nowcoder.com/questionTerminal/c47aa387f2c34e4dae48c97f0974646c
#include <stdio.h> int main(){ int a,b; scanf("%d",&a); if(a%10>=5){ b=a+(10-(a%10)); }else{ b=a-a%10; } printf("%d",b); }
四舍五入
http://www.nowcoder.com/questionTerminal/c47aa387f2c34e4dae48c97f0974646c
#include <stdio.h> int main(){ int a,b; scanf("%d",&a); if(a%10>=5){ b=a+(10-(a%10)); }else{ b=a-a%10; } printf("%d",b); }
相关推荐