Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.00 KB | None | 0 0
  1. // Reskova_Martina_4.ukol.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5.  
  6.  
  7. int _tmain(int argc, _TCHAR* argv[])
  8. {
  9.  
  10.     //Ukol cislo 1
  11.  
  12.     int i, n;
  13.  
  14.     printf("Zadejte cislo: ");
  15.     scanf("%d", &n);
  16.     i = n;
  17.     printf("Nasobky zadaneho cisla: ");
  18.     while(i<=100)
  19.     {
  20.     printf("%d ", i);
  21.     i = i + n;
  22.    
  23.     }
  24.  
  25.  
  26.     //Ukol cislo 3
  27.  
  28.     int i, j, n;
  29.  
  30.     printf("Zadejte rozmer: ");
  31.     scanf("%d", &n);
  32.     printf("n");
  33.  
  34.     for (i = 0; i < n; i++)
  35.     { //tiskne radky
  36.         for (j = 0; j < n; j++)
  37.         {
  38.             if((i == 0) || (i == (n - 1)))
  39.             {
  40.                 printf("*");
  41.             }
  42.            
  43.             else
  44.             {
  45.                 if((j == 0) || (j == (n - 1)))
  46.                 {
  47.                     printf("*");
  48.                 }
  49.                
  50.                 else
  51.                 {
  52.                     printf(" ");
  53.                 }
  54.             }
  55.           }
  56.        
  57.         printf("n");
  58.      }
  59.  
  60.  
  61.     return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement