1 solutions

  • 0
    @ 2025-12-15 11:58:21

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	string st[8]={"red","yellow","blue","black","white","puple","brown"};
    	string s;
    	int t=0,at=0;
    	getline(cin,s);
    	for(t=0;t<7;t++)
    	{
    		at=s.find(st[t]);
    		if(at!=-1) break; 
    	}
    	if(at!=-1) cout<<1<<endl<<st[t];
    	else cout<<0;
    	return 0;
    }
    
    • 1

    Information

    ID
    1046
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    6
    Tags
    # Submissions
    31
    Accepted
    11
    Uploaded By