作业帮 > 综合 > 作业

The variable 'sele' is being used without being initialized.

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/04/29 06:51:39
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.
scanf("%d",sele); 改成 scanf("%d",&sele);
再问: 谢谢啊