#include <stdio.h>
int main(void)
{
    char fever, cough;

    printf("Are you running a fever? (y/n)\n");
    scanf("%c",&fever);

    printf("Do you have a runny nose/cough? (y/n)\n");
    scanf(" %c",&cough);

    printf("Please verify the folling information.\nFever: %c \nRunny nose/cough: %c \n,fever,cough");
return 0;
}


当我运行它时,我得到:
12:2警告:格式'%c'需要匹配的'int'参数[-Wformat]

我需要更改什么?我知道所有事情在系统上都是正确的,我只需要使用其他东西,而我找不到任何可以解决我的问题的东西!

谢谢你们。

最佳答案

printf("Please verify the folling information.\nFever: %c \nRunny nose/cough: %c \n,fever,cough");


以上说法在系统上是不正确的。错误放置的"

像这样修改

printf("Please verify the folling information.\n Fever: %c \nRunny nose/cough: %c \n ",fever,cough);

08-16 20:53