Tag: 用户输入的

什么`scanf(“%* %* c”)`是什么意思?

我想在C中创建一个循环,当程序要求一个整数并且用户键入一个非数字字符时,程序再次请求一个整数。 我刚刚找到了以下代码。 但我不明白这意味着什么是scanf(“%*[^\n]%*c”) 。 ^\n是什么意思? ^\n和c之前的*是什么意思? /* This program calculate the mean score of an user 4 individual scores, and outputs the mean and a final grade Input: score1, score2,score2, score3 Output: Mean, FinalGrade */ #include //#include int main(void){ int userScore = 0; //Stores the scores that the user inputs float meanValue = 0.0f; //Stores […]