Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "Podaj n z przedzialu <0; 16>: ";
- unsigned int n;
- while(true)
- {
- cin >> n;
- if(n > 16)
- {
- cout << "n nie miesci sie w przedziale <0; 16>: ";
- }
- else
- {
- break;
- }
- }
- for(int i = 0; i < n; i++)
- {
- for(int j = 0; j < n; j++)
- {
- int c = i + j;
- if(c >= n)
- {
- c = c - n;
- }
- if(c == 10)
- {
- cout << "A";
- }
- else if(c == 11)
- {
- cout << "B";
- }
- else if(c == 12)
- {
- cout << "C";
- }
- else if(c == 13)
- {
- cout << "D";
- }
- else if(c == 14)
- {
- cout << "E";
- }
- else if(c == 15)
- {
- cout << "F";
- }
- else
- {
- cout << c;
- }
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement