Here's the question you clicked on:
timtimi
I have a problem in c++ : i should read a vector from the keyboard for example v=(2,4,8,25,3,66) and after this i should display another vector that contains the numbers 4 and 25 because 4=2*2 and 25=5*5 .
i.e. you want to use the cin to get input and a function that tests if the number is a square of another number?
this is an example for an array. #include <iostream> using namespace std; int main() { int list[]={6,7,8,9}; int i,j; for (i=0;i<4;i++) { for (j=0;j<list[i];j++) { if (j*j==list[i]) { cout<<list[i]<<"-->"<<j<<"F\n"; } } } }