Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.IO;
- using System;
- using System.Math;
- class Program
- {
- static void Main()
- {
- Console.WriteLine("Hello, World!");
- int n, temp, dem=0, i, sum;
- Console.WriteLine("Nhap so N: ");
- n = int.Parse(Console.ReadLine());
- temp=n;
- while(temp>0)
- {
- temp=temp/10;
- dem++;
- }
- while(n>0)
- {
- i=n%10;
- n=n/10;
- sum=sum+pow(i,dem);
- }
- if(sum==n)
- Console.WrileLine("{0} la so Armstrong",n);
- else
- Console.WrileLine("{0} khong la so Armstrong",n);
- Console.ReadKey;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement