20240703 作业

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, const char *argv[])
{
	int q = 0x12345678;
	char w = (char)q;
	if(w == 0x78)
	{
		printf("小端存储\n");
	}
	else
	{
		printf("大段存储\n");
	}
	char user;
	int password;
	printf("please enter user name:");
	user = getchar();
	getchar();
	printf("please enter password:");
	scanf("%d", &password);
	if(user == 'A' && password == 1234)
	{
		printf("登录成功\n");
	}
	else
	{
		printf("失败\n");
	}
	int a;
	int b;
	int c;
	printf("please enter 3 bian:");
	scanf("%d%d%d",&a,&b,&c);
	if(a+b>c && a+c>b && b+c>a){		
		if(a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a){
			printf("直角三角形\n");
		}else if(a == b && a ==c ){
			printf("等边三角形\n");
		}else if(a == b || a == c || b == c ){
			printf("等腰三角形\n");
		}else {
			printf("普通三角形\n");
		}
	}
	else{
		printf("不能构成三角\n");
	}


	return 0;


}

4.if(x <= 0.000001 &&  x >= -0.000001)

5.a= 6  b= 7 c= 12

6.d=5

7.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, const char *argv[])
{
	int num;
	printf("please enter a number:");
	scanf("%d", &num);
	if(num % 3 == 0)
	{
		printf("3 ");
	}
	 if(num % 5 == 0)
	{
		printf("5 ");
	}
	if(num % 7 == 0)
	{
		printf("7");
	}
	putchar(10);
	if(num % 3 != 0 && num % 5 != 0 && num % 7 != 0)
	{
		printf("n");
	}
	putchar(10);
	return 0;
}

8.b = 10   c = 12  d = 120

9. c=-75   a=181   d= 5   e= 5

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值