150 ile 410 arasındaki tamsayılardan; her basamaktaki sayının küpleri toplamı kendisine eşit olan sayıları bularak yazdıran program

H

HZ.CİN

Cin Terbiyecisi
Thread Starter
Ultra Member
Joined
Dec 22, 2019
Messages
387
Reaction score
73
Location
Cehennem
C#:
 for (int sayi = 150; sayi <= 400; sayi++)
        {

            int yuzler = sayi / 100;

            int onlar = (sayi % 100) / 10;

            int birler = sayi % 10;

            int kupleriTopla = (yuzler * yuzler * yuzler) + (onlar * onlar * onlar) + (birler * birler * birler);

            if (kupleriTopla == sayi)
                Console.WriteLine(sayi.ToString() +" sayısı eşittir");
        }
        Console.ReadLine();
 
SPAM IS FORBIDDEN!
  • SPAMMERS ARE BANNED FROM THE FORUM AND CANNOT USE ANY OF THE CHEATS
  • For example: thanks, thx, very good, asdqwe, working, ty and so on!
  • For example: Writing the same message over and over. thanks, thx and so on!
  • Copying and copying someone else's message is prohibited.
  • It is forbidden to send messages to increase the number of comments on threads that you have no knowledge of.
  • Write your own opinion when commenting!
  • If you see spam message, please let us know with the REPORT button!

Theme editor

Top Bottom