Search
 
SCRIPT & CODE EXAMPLE
 

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to split string in c++ 
Cpp :: C++ Area and Perimeter of a Rectangle 
Cpp :: even and odd sum in c++ 
Cpp :: c++ encapsulation 
Cpp :: print octal number in c++ 
Cpp :: c++ initialize vector of vector with size 
Cpp :: c++ double is nan 
Cpp :: stoi() c++ 
Cpp :: untitled goose game 
Cpp :: abs in cpp 
Cpp :: c++ insert into map 
Cpp :: currency converter c++ 
Cpp :: classes and objects in c++ 
Cpp :: how to find min of two numbers in c++ 
Cpp :: power function c++ 
Cpp :: c include 
Cpp :: c++ squaroot 
Cpp :: operand-- c++ 
Cpp :: login system with c++ 
Cpp :: C++ continue with for loop 
Cpp :: comparing characters of a string in c++ 
Cpp :: c++ range based for loop 
Cpp :: c++ remove chars from string 
Cpp :: how to create a c++ templeate 
Cpp :: c++ constructor call superclass 
Cpp :: substring in c++ 
Cpp :: fill vector with zeros c++ 
Cpp :: Lambda capture as const cpp 
Cpp :: copy constructor c++ syntax 
Cpp :: c++ define constant in class header 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =