int a=1,b=3; double c=a*100/b; printf("%.3lf%%\n",c);printf("%.3lf%%\n",(double)a*100/b);
#include <stdio.h> int main(void) { int a=1,b=3; double c=a*100.0/b;//此处改为这个!! printf("%.3lf%%\n",c);printf("%.3lf%%\n",(double)a*100/b); }