Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

what is compilation error in this case?

$
0
0
#include<iostream>
#include<math.h>
#include<string.h>
using namespace std;
int main()
{
int cases,hints,no;
char oper;
string ans="";
int noo,i=0,j=0;
cin>>cases;
int countt[cases];
while(j<cases)
{
    countt[j]=1;
    cin>>hints;
    i=0;
    no=rand();
    while(i<hints)
    {
        cin>>oper>>noo>>ans;
        if(oper=='=')
        {
            if(noo==no && ans=="No")
                countt[j]++;
            if(noo!=no && ans=="Yes")
                countt[j]++;
        }
        else if(oper=='<')
        {
            if(noo<no && ans=="No")
                countt[j]++;
            if(noo>=no && ans=="Yes")
                countt[j]++;
        }
        else if(oper=='>')
        {
            if(noo>no && ans=="No")
                countt[j]++;
            if(noo<=no && ans=="Yes")
                countt[j]++;
        }
        i++;
    }
    j++;
 }
for(i=0;i<cases;i++)
{
    cout<<countt[i]<<endl;;
}

}


Viewing all articles
Browse latest Browse all 39796

Trending Articles