Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OCENY:
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int t[n], T[6], i, j, b = 0;
- for(i = 0; i < n; i++) cin >> t[i];
- for(i = 1; i <= 6; i++)
- {
- b = 0;
- for(j = 0; j < n; j++) if(i == t[j]) b++;
- T[i-1] = b;
- }
- for(i = 0; i < 6; i++) cout << T[i] << " ";
- return 0;
- }
- plaindrom:
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char wyraz[1000000];
- cin >> wyraz;
- int a = strlen(wyraz);
- int i=0, j=a-1, b=0;
- for(i, j; i <= a/2; i++, j--) if(wyraz[i] == wyraz[j]) b++;
- if(b == (a/2)+1) cout << "TAK"; else cout << "NIE";
- return 0;
- }
- piersze liczby:
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, i, j=0;
- cin >> a;
- for(i = 1; i <= a; i++)
- if(a%i == 0) j++;
- if(j == 2) cout << "pierwsza"; else cout << "zlozona";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement