>284
ここはエスパーすれなんだから、nameが50文字以内の文字列ということまで透視しないと。

というわけで、
for(int i=0; i<50; i++)
 if(name[i]=='\0') break;
cout << (i==50 ? "NG" : "OK");