|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
警告信息:
警告 C6064 缺少“scanf_s”的整型参数(对应于转换说明符“2”)。
警告 C4473 “scanf_s”: 没有为格式字符串传递足够的参数 Project1
- #include<stdio.h>
- int main(void)
- {
- long ilong;
- short ishort;
- int num1 = 1;
- int num2 = 2;
- char ichar[10] ;
- printf("Enter the long interger:\n");
- scanf_s("%ld", &ilong);
- printf("Enter the short interger:\n");
- scanf_s("%hd", &ishort);
- printf("Enter the number:\n");
- scanf_s("%d*%d", &num1, &num2);
- printf("Enter the string but only show three character\n");
- scanf_s("%3s", ichar);
- printf("the long interger is %ld\n", ilong);
- printf("the short interger is %hd\n", ishort);
- printf("the num1 is :%d\n", num1);
- printf("the num2 is :%d\n", num2);
- printf("the three character are :%s\n", ichar);
- return 0;
- }
复制代码
- #include<stdio.h>
- int main(void)
- {
- long ilong;
- short ishort;
- int num1 = 1;
- int num2 = 2;
- char ichar[10];
- printf("Enter the long interger:\n");
- scanf_s("%ld", &ilong);
- printf("Enter the short interger:\n");
- scanf_s("%hd", &ishort);
- printf("Enter the number:\n");
- scanf_s("%d*%d", &num1, &num2);
- printf("Enter the string but only show three character\n");
- scanf_s("%3s", ichar, 10); // <---------------------------------- 注意这里
- printf("the long interger is %ld\n", ilong);
- printf("the short interger is %hd\n", ishort);
- printf("the num1 is :%d\n", num1);
- printf("the num2 is :%d\n", num2);
- printf("the three character are :%s\n", ichar);
- return 0;
- }
复制代码
|
|