The variable 'sele' is being used without being initialized./*this is the first program that designed by my self*/#include <stdio.h>int main(void){\x05int sele;\x05float a1;\x05float h1; printf("select the type:\n1-triangle"); sc

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 18:59:08

The variable 'sele' is being used without being initialized./*this is the first program that designed by my self*/#include <stdio.h>int main(void){\x05int sele;\x05float a1;\x05float h1; printf("select the type:\n1-triangle"); sc
The variable 'sele' is being used without being initialized.
/*this is the first program that designed by my self*/
#include <stdio.h>
int main(void)
{
\x05int sele;


\x05float a1;
\x05float h1;
    printf("select the type:\n1-triangle");
   scanf("%d",sele);


\x05if(sele==1)
\x05getchar();
\x05{
\x05
\x05printf("please select the shape:\n1_rectangle\n");
\x05
     printf("please type in the base of triangle(the defualt length unit is cm):");
\x05scanf("%f",&a1);
\x05getchar();
\x05printf("please type in the height of the triangle(the defualt length unit is cm):");
\x05scanf("%f",&h1);
\x05getchar();
\x05printf("the area of triangle is:%.2f",a1*h1);
\x05getchar();
\x05return 0;
\x05}
\x05
\x05}






编译时没有提示错误  没有下划红色波浪线
但是一运行就提示不行!

The variable 'sele' is being used without being initialized./*this is the first program that designed by my self*/#include <stdio.h>int main(void){\x05int sele;\x05float a1;\x05float h1; printf("select the type:\n1-triangle"); sc
scanf("%d",sele); 改成 scanf("%d",&sele);