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 ...
随机推荐
- part1
一.hello world 明确的指出 hello.py 脚本由 python 解释器来执行.coding:utf-8处理脚本中的中文 #!/usr/bin/env python # _*_ codi ...
- anaconda安装Opencv报错:Could NOT find PythonLibs: Found unsuitable version "2.7.6",
机器上装了两个python,一个是默认的,一个是anaconda.安装opencv时就报错了: -- Found PythonInterp: /home/deeplp/anaconda2/bin/py ...
- 逃逸分析(Escape Analysis)
一.什么是逃逸 逃逸是指在某个方法之内创建的对象,除了在方法体之内被引用之外,还在方法体之外被其它变量引用到:这样带来的后果是在该方法执行完毕之后,该方法中创建的对象将无法被GC回收,由于其被其它变量 ...
- 自定义 serializeJSON() 函数
说明:jQuery框架提供了serialize()方法, 能够将DOM元素内容序列化为json格式字符串,用于ajax请求.通过使用serialize()方法,可以提交本页面的所有域. 但是此方法具有 ...
- makefile(一)
Makefile的一个具体的实例 来源:http://blog.sina.com.cn/s/blog_73d4d5fa0100paiy.html (2011-03-06 23:10:02) 转载▼ 标 ...
- jquery通过AJAX从后台获取信息并显示在表格上的类
前一阵我写了:<jquery通过AJAX从后台获取信息并显示在表格上,并支持行选中.>现在,我把他们处理了一下,不需要每次写代码了: 具体代码如下: //获取数据并显示数据表格 funct ...
- FileStream说明
FileStream(String, FileMode) FileStream(String path, FileMode) 文件打开模式:(FileMode)包括6个枚举 Append:追加 ...
- 吴裕雄 python 机器学习——岭回归
import numpy as np import matplotlib.pyplot as plt from sklearn import datasets, linear_model from s ...
- OpenCV4.0学习笔记
1.读取显示图像 #include<opencv2/opencv.hpp> #include<iostream> using namespace cv; using names ...
- linux下面重启nfs报错:nfs-server.service:main process exited
linux下面重启nfs报错:nfs-server.service:main process exited [root@dhcp-66-83-39 images]# service rpcbind s ...