当前位置:网站首页>学习作业:
学习作业:
2022-07-21 13:53:00 【51CTO】
求最大公约数:辗转相除法
#include<stdio.h>
int main()
{
int m =0;
int n = 0;
int r = 0;
scanf("%d%d", &m, &n);
while (m % n)
{
r = m % n;
m = n;
n = r;
}
printf("%d\n", n);
return 0;
}
自动关机:
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
char input[20] = { 0 };
//shutdown-s-t 60
//system()-执行命令的
system("shutdown -s -t 60");
again:
printf("请注意,你的电脑在一分钟内关机,如果输入:我是猪,就取消关机\n请输入>:");
scanf("%s", input);
if (strcmp(input, "我是猪") == 0)
{
system("shutdown -a");
}
else
{
goto again;
}
return 0;
}
边栏推荐
猜你喜欢
Onvif协议及协议测试工具使用详解
半导体产业动态杂谈
814. 二叉树剪枝 : 简单递归运用题
StringUtils 和 String 方法一览
Matlab least square fitting
ES6 from getting started to mastering 06: arrow function this direction and precautions
Photovoltaic power generation system and its MPPT control
牛客网刷题——第三天
92. (leaflet chapter) leaflet situation plotting - acquisition of attack direction
电脑是怎样上网的 (四) 局域网与服务器响应
随机推荐
[wechat applet authorization] obtain the user's mobile number and nickname
How to use API interface to batch query book information?
Figure neural network: gat learning, understanding and pit entry
十大券商开户安全吗,风险大吗?
07. Use of octave language - variables, values, vectors, matrices
移动机器人(四)四轴飞行器
ES6 from getting started to mastering 02:let and const commands
[JS foundation] common methods of operating arrays in JS
2022长三角工业自动化展会将于10月在南京国际展览中心召开
Write it down once Net analysis of CPU explosion of an intelligent transportation background service
The ultra-low price of domestic chips, while being replaced by domestic products, has led to a large number of exports, putting pressure on American chips
The state Internet Information Office made a decision on the administrative punishment related to the network security review of didi Global Co., Ltd. in accordance with the law
Onvif协议及协议测试工具使用详解
启牛可以开户安全吗?
OpenAI正式宣布DALL-E向100万个用户开放测试版
国家互联网信息办公室对滴滴全球股份有限公司依法作出网络安全审查相关行政处罚的决定
Matlab FCM fuzzy clustering
Those violations in the store will be punished by the official secondary punishment, the most common four
MySQL:MySQL客户端和服务端之间是如何连接的呢?
一次 MySQL 误操作导致P0级事故