Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Accpt array input in single line in cpp

//input:5
        1 2 3 4 7



int main() {
    int n;
    cin>>n;
    int array[n];
    for (int i =0;i<n;i++){
        cin>>array[i];
    }
    cout<<array; 
    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Accpt #array #input #single #line #cpp
ADD COMMENT
Topic
Name
5+5 =