求车速
#include <stdio.h>
int main()
{
int a[5], i;
long int b, c;
for (b = 95860;; b++) {
for (i = 0, c = 100000; c >= 10; i++) {
a[i] = (b % c) / (c / 10);
c /= 10;
}
if ((a[0] == a[4]) && (a[1] == a[3])) {
printf("里程表上出现的新的对称数为:%d%d%d%d%d\n", a[0], a[1], a[2], a[3], a[4]);
printf("该车的速度为:%.2f\n", (b - 95859) / 2.0);
break;
}
}
}
标签:10,12,int,d%,printf,打卡 From: https://www.cnblogs.com/0608lin/p/17382753.html