Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- int n,s,x;
- int const maks = 100;
- int T[maks];
- void piszT(int n,int T[maks])
- {
- for(int i=0; i<n;i++){
- cout<<i<<". "<<T[i]<<endl;
- }
- }
- void czytajT(int n,int T[maks])
- {
- for(int i=0; i<n;i++){
- cin>>T[i];
- }
- }
- void losT(int n, int T[maks])
- {
- for(int i=0;i<n;i++)
- {
- T[i]=rand()%(101);
- }
- }
- int main(){
- cout<<"Wielkosc tablicy: "<<endl;
- cin>>n;
- if(n>100)
- {
- cout<<"zle"<<endl;
- }
- else{
- czytajT(n,T);
- piszT(n,T);
- }
- x=0;
- for(int i=0;i<=n-2;i++){
- for(int j=i+1;j<=n-1;j++)
- {
- if (T[i]==T[j])
- {
- x=1;}
- }
- }
- cout<<x<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement