Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CV_13
- {
- class Program
- {
- static void Main(string[] args)
- {
- int číslo = 0;
- int[] pole = new int[10000];
- Console.WriteLine("Zadejte dělenec:");
- int vstup1 = int.Parse(Console.ReadLine());
- Console.WriteLine("zadejte dělitel:");
- int vstup2 = int.Parse(Console.ReadLine());
- while (vstup1 > 0)
- {
- vstup1 -= vstup2;
- číslo++;
- if(vstup1 >0)
- {
- pole[číslo] = vstup1;
- }
- }
- if (pole[číslo-1] == vstup2)
- {
- Console.WriteLine($"výsledek je {číslo} zbytek je: 0");
- }
- else
- {
- Console.WriteLine($"výsledek je: {číslo-1} zbytek je: {pole[číslo - 1]} "); //zbytek = pole[číslo-1]
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement