Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int Lelementow;
- cout<< "podaj liczbe elementow";
- cin>>Lelementow;
- float x[Lelementow];
- float y[Lelementow];
- bool powt=0;
- cout<< "podaj x:"<<endl;
- for(int i = 0 ; i< Lelementow; i++ )
- {
- cout<<"x["<<i<<"] ";
- cin>>x[i];
- }
- for (int i=0;i<Lelementow;i++)
- {
- for(int j=i+1;j<Lelementow;j++)
- {
- if(x[i]==x[j]){
- powt=1;
- break;
- }
- }
- if(powt) break;
- }
- if(powt) {cout<<"x sie powtarzaja";return -1};
- return 0;
- }
Add Comment
Please, Sign In to add comment