Naći sve četverocifrene brojeve, oblika abcd , takve da je 2 * abc = bcd,
npr: 2500, jer je 2 * 250 = 500.
#include using namespace std; int main() { //Naći sve četverocifrene brojeve, oblika abcd, //takve da je 2 * abc = bcd, npr: 2500, jer je 2 * 250 = 500. int a,b,c,d; cout<<"Trazeni brojevi 1000-10000 su : "<<endl; for(int i=1000;i<10000;i++) { int j=i; a=j/1000;j%=1000; b=j/100;j%=100; c=j/10;j%=10; d=j; if(2*(a*100+b*10+c)==(b*100+c*10+d)) cout<<i<<endl; } system("Pause"); return 0; }