experiment 3
#include <stdio.h>
int main() {
int number, max, min, n; n=;
printf("请输入%d个数: ", n);
scanf("%d", &number); max = number;
min = number; while(n<=) {
n++;
printf("请输入第%d个数: ", n);
scanf("%d", &number); if(number>max)
max = number;
else if(number<min)
min = number;
} printf("最大数为: %d\n", max);
printf("最小数为: %d\n", min); return ;
}
#include <stdio.h>
int main()
{
int i = ;
int j = ;
for (i = ; i <=; i+=)
{
for (j = ; j<=i; j++)
{
if ( == i%j)
{
break;
}
}
if (j == i)
printf("%d ",i);
} return ;
}
#include <stdio.h>
int trangle(int n)
{
int i,j;
for(i = ;i<n;i++)
{
for(j = ;j<=n-i;j++)
putchar(' ');
for(j = ;j<=*i;j++)
putchar('*');
putchar('\n');
}
return ;
} int main()
{
int n;printf("Enter n:");
scanf("%d",&n);
printf("\n");
trangle(n);
return ;
}
part 1 answer:
1.
break语句:用于永久终止循环
continue语句:用于终止本次循环
2.
均不影响
experiment 3的更多相关文章
- An interesting experiment on China’s censorship
This paper presented a very interesting topic. Censorship in China has always drawn people's attenti ...
- Reading With Purpose: A grand experiment
Reading With Purpose: A grand experiment This is the preface to a set of notes I'm writing for a sem ...
- ural 2062 Ambitious Experiment
2062. Ambitious Experiment Time limit: 3.0 secondMemory limit: 128 MB During several decades, scient ...
- [POJ3684]Physics Experiment
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1363 Accepted: 476 Special Judge ...
- poj 3684 Physics Experiment(数学,物理)
Description Simon ), the first ball is released and falls down due to the gravity. After that, the b ...
- ural2062 Ambitious Experiment
Ambitious Experiment Time limit: 3.0 secondMemory limit: 128 MB During several decades, scientists f ...
- Codeforces 431E Chemistry Experiment 线段树 + 二分
Chemistry Experiment 维护一个权值线段树,然后二分答案. #include<bits/stdc++.h> #define LL long long #define LD ...
- ural Ambitious Experiment 树状数组
During several decades, scientists from planet Nibiru are working to create an engine that would all ...
- 20162314 Experiment 2 - Tree
Experiment report of Besti course:<Program Design & Data Structures> Class: 1623 Student N ...
- 20162314 Experiment 1: Linear structure - experiment report.
Experiment report of Besti course:<Program Design & Data Structures> Class: 1623 Student N ...
随机推荐
- Xeon Phi 《协处理器高性能编程指南》随书代码整理 part 4
▶ 第五章,几个优化 ● 代码 #include <stdio.h> #include <stdlib.h> #include <math.h> #define S ...
- c#中委托和事件(转)
C# 中的委托和事件 引言 委托 和 事件在 .Net Framework中的应用非常广泛,然而,较好地理解委托和事件对很多接触C#时间不长的人来说并不容易.它们就像是一道槛儿,过了这个槛的人,觉得真 ...
- pgadmin连接 postgresql远程设置
背景:通过yum默认方式将pgsql10安装在centos7, pgsql 的配置文件在:/var/lib/pgsql/10/data. 配置文件:postgresql.conf 和 pg_hba.c ...
- 拾遗----javascript一些实用方法
1. join() join() 方法用于把数组中的所有元素放入一个字符串.元素是通过指定的分隔符进行分隔的. var ids = []; for(var i = 0 ...
- anujs1.4.0发布
经过三个月的埋头苦干,终于完成Fiber版的anujs. 主要特性有: 测试全部改成jest, 迁移官方测试用例.有许多迷你React吹得怎么天花乱坠,但是生命周期钩子的执行顺序无法与官方保持一致,那 ...
- ZigZag Conversion 之字形转换字符串
1.题目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows ...
- [Ting's笔记Day9]活用套件Carrierwave gem:(4)使用Imagemagick修改图片大小
前情提要: 这几天我都在实验Carrierwave这套图片上传套件,也顺利部署到Heroku架站正式环境了.:) 接下来我遇到了新的问题:要如何在上传的时候,让Carrierwave gem大型siz ...
- 基于WebGL架构的3D可视化平台—实现小车行走路线演示
小车行走路线演示New VS Old 刚接触ThingJS的时候,写的一个小车开进小区的演示,今天又看了教程中有movePath这个方法就重新写了一遍,其中也遇到了一些问题,尤其突出的问题就是小车过弯 ...
- Linux Apache配置https访问
配置https访问 该环境是rh254课程配套的一个环境,不过配置方法步骤相同. 要求: 使用虚拟主机技术部署两个网站: 网站1: 绑定域名 www0.example.com 目录在 /srv/www ...
- Ubuntu 批量添加用户
#!/bin/bash cat user.txt | while read linedo user=$(echo $line | cut -d ' ' -f1) passwd=$(echo ...