键盘输入字符串

#include <stdio.h>

int main(void)
{
  char initial[3] = {' '};
  char name[80] = {' '};

  printf("Enter your first initial:  ");
  gets_s(initial, sizeof(initial));
  printf("Enter your name:  " );
  gets_s(name, sizeof(name));
  if(initial[0] != name[0])
    printf("%s, you got your initial wrong./n", name);
  else
    printf("Hi, %s. Your initial is correct. Well done!/n", name);
  return 0;
}

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266493.html

(0)
上一篇 2022年6月7日
下一篇 2022年6月7日

相关推荐

发表回复

登录后才能评论