Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int n = 0;
- cout << "Podaj liczbe calkowita: ";
- cin >> n;
- //Od 1 do n
- for(int i=1;i<=n;i++)
- {
- cout << i << " ";
- }
- //Od n do 1
- cout << "\n";
- for(int i=n;i>=1;i--)
- {
- cout << i << " ";
- }
- //nieparzyste <n
- cout << "\n";
- for(int i=n;i>=1;i--)
- {
- if(i%2 != 0)
- {
- cout << i << " ";
- }
- }
- //parzyste <n
- cout << "\n";
- for(int i=n;i>=1;i--)
- {
- if(i%2 == 0 && i%3 == 2)
- {
- cout << i << " ";
- }
- }
- //wielokrotnosci 5
- cout << "\n";
- for(int i=n;i>=1;i--)
- {
- if(i%5 == 0)
- {
- cout << i << " ";
- }
- }
- //od A do Z
- cout << "\n";
- for(int i='a';i<='z';i++)
- {
- cout << (char)i << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement