Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <cmath>
- using namespace std;
- int main(int argc, char *argv[])
- {
- cout<<"podaj wielkość tablicy";
- int n,i;
- cin>>n;
- int tab[n];
- cout<<"podaj "<<n<<"elementow tablicy"<<endl;
- for (i=1 ; i<=n ; i++){
- cin>> tab[i];
- cout<<endl;}
- cout<<"wynik";
- for (i=1;i<=n ; i++){
- int j=i*i;
- if (j<=n)
- cout<<tab[j]<<endl;}
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement