A truck violated the traffic rules and ran away after hitting people. Three people witnessed the scene, but did not remember the car number, only to note some of the characteristics of the car number. A said: The first two digits of the licence are the same; B said: The last two digits of the licence are the same, but different from the first two; C is a mathematician, he said: The four-bit car number is exactly the square of an integer. Please ask for the car number according to the above clue.
#include <stdio.h>#include <math.h>intMain () {intI,j,k,c; for(i=1; i<=9; i++) for(j=0; j<=9; j + +)if(I!=J) {k=i*1000+i*100+j*10+j; for(c= to; c*c<k;c++);if(c*c==K)printf("%d\ n", k); }}
#include <stdio.h>#include <math.h>void Printb (int,int);intMain () {intI,a,b,c,d,e; for(i= +; i<=9999; i++) {a=i/ +; B= (i-a*1000)/ -;if(a==b) {c= (i-a*1000-B*100)/Ten; D=i-a*1000-B*100-C*10;if(C==d) {e=sqrt(i);if(E*e==i) {printf("%d", i); } } } }}
Catch the Traffic accident crime