Advertisement
piotrek77

które liczby dwucyfrowe dzielą się bez reszty przez iloczyn

Mar 5th, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             for (int i = 1; i < 10; i++)
  15.             {
  16.  
  17.                 for (int j = 1; j < 10; j++)
  18.                 {
  19.                     int liczba = 10*i + j;
  20.                     //Console.WriteLine(String.Format("{0}{1}", i, j));
  21.                     int iloczyn = i * j;
  22.                     int reszta = liczba % iloczyn;
  23.  
  24.  
  25.                     if (reszta == 0)
  26.                     {
  27.                         Console.WriteLine("Liczba={0}", liczba);
  28.                         Console.WriteLine("Iloczyn={0}", iloczyn);
  29.                         Console.WriteLine("Reszta={0}", reszta);
  30.                     }
  31.                 }
  32.  
  33.             }
  34.  
  35.  
  36.             Console.ReadLine();
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement