VS2017中scanf_s过不去
程序代码:
#include<stdio.h> int main() { struct Student { int num; char name[20]; float score; }student1,student2; printf("input student1:\n"); scanf_s("%d%s%f", &student1.num, student1.name, &student1.score); printf("input student2:\n"); scanf_s("%d%s%f", &student2.num, student2.name, &student2.score); printf("The higher score is:\n"); if (student1.score > student2.score) printf("%d %s %6.2f", student1.num, student1.name, student1.score); else if(student1.score<student2.score) printf("%d %s %6.2f", student2.num, student2.name, student2.score); else { printf("%d %s %6.2f", student1.num, student1.name, student1.score); printf("%d %s %6.2f", student2.num, student2.name, student2.score); } return 0; }
我照着答案敲的