lab6-89

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; int main() { int n,counter=20; bool equals=false; cout << "Input the fist element of the sequence :"<<endl; cin>>n; for(int i=0,j=n;i<20,j<=n+20;i++,j++) { //showing the content cout<<endl; cout<<j<<endl; //////////////////// if(i+1<20) { if(j==j+1) { equals=true; break; } else { equals=false; } } } if(equals) cout<<"the elements of the given sequence are equals !"<<endl; else cout<<"the elements of the given sequence are not equals !"<<endl; int *massive = new int[20]; for(int i = 0; i<20; i++) { cin >> massive[i]; } bool r = true; for(int i = 0; i<20; i++) { for(int j = 0; j<20; i++) { if(!massive[i] == massive[j]) { r = false; break; } } if(r == false) break; } if(r) cout<<"the elements of the given sequence are equals !"<<endl; else cout<<"the elements of the given sequence are not equals !"<<endl; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines