Advertisement
Guest User

Untitled

a guest
May 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 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.         for(int i = 1 ; i <= zostalo / ile ; i++)
  30.         {
  31.             for(int j = 0 ; j < ile ; j++)
  32.             {
  33.                 litera = litera + 1;
  34.                 if(litera != 'Z')
  35.                 {
  36.                 cout << litera << ", ";
  37.                 }
  38.                 else   
  39.                     cout << litera << ", ";
  40.                     j = ile;
  41.             }
  42.             cout << "\n";
  43.         }
  44.     }
  45.     else
  46.     {
  47.         for(int i = 1 ; i <= zostalo / ile ; i++)
  48.         {
  49.             for(int j = 0 ; j < ile ; j++)
  50.             {
  51.             litera = litera + 1;
  52.  
  53.             cout << litera << ", ";
  54.             }
  55.             cout << "\n";
  56.         }
  57.     }
  58.     system("pause");
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement