以下程序片段,对从键盘输入由5个字符组成的单词,判断此单词是不是“hello ” ,并显示结果。 char str[ ]={‘h’,’e’,’l’,’l’,’o’}, str1[5]; i,flag; gets(str1); flag=0; for(i=0;i<5;i++ ) if (str1[i]!=str[i]) {flag= ; break;} if(flag ) printf("this word is not hello"); else printf("this word is hello"); }