3.代码示例
#include<iostream> using namespace std; int main(){ int i,n,j,a[5],s; for(i=95860;;i++){ for(j=i,n=0;j>0;n++){ a[n]=j%10; j=j/10; } if(a[0]==a[4]&&a[1]==a[3]){ cout<<"里程数为:" ; for(s=0;s<5;s++) cout<<a[s]; cout<<endl<<"车速为:"<<(i-95859)/2.0; break; } } return 0; }
4.结果输出
标签:std,10,示例,int,++,Day16 From: https://www.cnblogs.com/cream867/p/17378617.html