When it comes to a structure problem , The output is always wrong , No reason can be found . The questions are as follows :
typedef struct student { float grade[3]; long long int number; }stu; int
main() { stu stu1; scanf("%d;%f,%f,%f", &(stu1.number), &(stu1.grade[0]),
&(stu1.grade[1]), &(stu1.grade[2])); printf("The each subject score of No. %d
is %.2f, %.2f, %.2f.\n",stu1.number,stu1.grade[0],stu1.grade[1],stu1.grade[2]);
return 0; } // input :1410202;77,88,99 // output :The each subject score of No. 1410202 is
0.00, 0.00, 0.00. // Expected results :The each subject score of No. 1410202 is 77.00, 88.00,
99.00.
here , that is because number yes long long int type , In this code, both input and output are %d, The output result is wrong .

To avoid this problem , Yes 16 Input and output of base number should be used %lld Format input output

example :long long int number;

scanf("%lld",&number);

printf("%lld\n",number);

 

Technology
©2019-2020 Toolsou All rights reserved,
Hikvision - Embedded software written test questions C Language application 0 The length of array in memory and structure is 0 In depth analysis data structure --- The preorder of binary tree , Middle order , Subsequent traversal How to do it ipad Transfer of medium and super large files to computer elementui Shuttle box el-transfer Display list content text too long 2019 The 10th Blue Bridge Cup C/C++ A Summary after the National Games ( Beijing Tourism summary )unity Shooting games , Implementation of first person camera python of numpy Module detailed explanation and application case Study notes 【STM32】 Digital steering gear Horizontal and vertical linkage pan tilt Vue Used in Element Open for the first time el-dialog Solution for not getting element