Help me in solving TRANSFORM problem

My issue

i solved but when i going to submitted there shows runtime error
include <bits/stdc++.h>
using namespace std;

int main()
{
int t;
cin>>t;
for(int i=1;i<=t;i++)
{
int x;
cin>>x;
string c[3]={“NORMAL”,“HUGE”,“SMALL”};
if(x<=3)
{
cout<<c<<“\n”;
}
else
{
cout<<c[x%3]<<“\n”;
}
}
return 0;
}

My code

#include <bits/stdc++.h>
using namespace std;

int main() 
{
    int t;
    cin>>t;
    for(int i=1;i<=t;i++)
    {
        int x;
        cin>>x;
        string c[3]={"NORMAL","HUGE","SMALL"};
        if(x<=3)
        {
            cout<<c[x]<<"\n";
        }
        else
        {
            cout<<c[x%3]<<"\n";
        }
    }
    return 0;
}

Problem Link: Mario and Transformation Practice Coding Problem - CodeChef

@bais2004
plzz refer my c++ code for better understanding

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int x;
	    cin>>x;
	    if(x%3==0)
	    cout<<"NORMAL"<<endl;
	    else if(x%3==1)
	    cout<<"HUGE"<<endl;
	    else
	    cout<<"SMALL"<<endl;
	    
	}
	return 0;
}
1 Like