Advertisement
Guest User

Untitled

a guest
May 25th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     char litera = '@';
  9.  
  10.     for(int i = 1 ; i < 5 ; i++)
  11.     {
  12.         for(int j = 1 ; j < 3 ; j++)
  13.         {
  14.         litera = litera + 1;
  15.  
  16.         cout << litera << ", ";
  17.         }
  18.         cout << "\n";
  19.     }
  20.     int ile;
  21.  
  22.     cout << "Po ile liter w rzedzie mam wypisywac dalej?: ";
  23.     cin >> ile;
  24.  
  25.     int zostalo = 18;
  26.    
  27.     if(zostalo % ile)
  28.     {
  29.         do
  30.         {
  31.             for(int i = 1 ; i <= zostalo / ile ; i++)
  32.             {
  33.                 for(int j = 0 ; j < ile ; j++)
  34.                 {
  35.                     litera = litera + 1;
  36.                     cout << litera << ", ";
  37.                 }
  38.                 cout << "\n";
  39.             }
  40.         }
  41.         while(litera != 'Z');
  42.     }
  43.     else
  44.     {
  45.         for(int i = 1 ; i <= zostalo / ile ; i++)
  46.         {
  47.             for(int j = 0 ; j < ile ; j++)
  48.             {
  49.             litera = litera + 1;
  50.  
  51.             cout << litera << ", ";
  52.             }
  53.             cout << "\n";
  54.         }
  55.     }
  56.     system("pause");
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement