C/C++

C programming

4 Responses

  1. #include
    #include
    #include

    using namespace std;

    int main(){
    int init_data;
    int cnt=0;
    while(cin>>init_data && init_data!=-1){
    if(cnt) cout<<endl;
    cnt++;
    vector h,m;
    h.push_back(init_data);
    m.push_back(1);
    int data;
    while(cin>>data && data!=-1){
    int max=0;
    for(int i=h.size()-1;i>=0;i–){
    if(h[i]>=data){
    if(m[i]>max) max=m[i];
    }
    }
    m.push_back(max+1);
    h.push_back(data);
    }
    cout<<”Test #”<<cnt<<’:'<<endl <<” maximum possible interceptions: “<<*max_element(m.begin(),m.end())<<endl;
    }
    cout<<endl;
    }

  2. I need C# programming code.

  3. Can u please tell me the way to take input for acm-icpc problems?? Is it from a file or arguments or what???

  4. would u please tell me which books are good for beginers

Leave a Reply