北京理工大学复试上机--2001A
#include <iostream>
using namespace std;
int main() {
double x;
while(cin >> x) {
if(x >= && x < ) {
cout << 2.5 - x << endl;
}
else if(x >= && x < ) {
cout << - 1.5 * (x - ) * (x - ) << endl;
}
else if(x >= && x < ) {
cout << x / - 1.5 << endl;
}
else {
cout << "请输入0-6的数字";
continue;
}
}
return ;
}
#include <iostream>
using namespace std;
int main() {
int n;
while(cin >> n) {
int sum = ;
if(n > ) {
for(int i = n; i <= * n; i++) {
sum += i;
}
}
else {
for(int i = -n; i <= * (-n); i++) {
sum -= i;
}
}
cout << sum << endl;
}
return ;
}
#include <iostream>
using namespace std; int main() {
int n, m;
for(int i = ; i < ; i++) {
for(int j = ; j < ; j++) {
for(int k = ; k < ; k++) {
for(int l = ; l < ; l++) {
n = i * + j * + k * + l;
m = l * + k * + j * + i;
if(n * == m && m > ) cout << n << endl; //无限制m>0,会多输出0
}
}
}
}
return ;
}
#include <iostream>
using namespace std; struct Node
{
int data;
Node* next;
}; int main() {
int m;
cin >> m;
while (m--) {
int n;
cin >> n;
Node *head = new Node;
Node *p = new Node;
head = p;
p -> next = NULL;
p -> data = ;
for(int i = ; i <= n; i++) {
Node *q = new Node;
q -> data = i;
q -> next = NULL;
p -> next = q;
p = q;
}
p -> next = head;
int cnt = ;
while(head -> next != head) {
Node *t = new Node;
t = head -> next;
cnt++;
if(cnt % == ) {
cout << head -> next -> data << " ";
head -> next = t -> next;
}
else head = head -> next;
}
cout << head -> data << endl;
}
return ;
}
北京理工大学复试上机--2001A的更多相关文章
- 北京理工大学复试上机--2001B
1.请输入高度 h,输入一个高为 h,上底边长为 h的等腰梯形(例如 h=4,图形如下). **** ****** ******** ********** #include <ios ...
- Twin Prime Conjecture(浙大计算机研究生保研复试上机考试-2011年)
Twin Prime Conjecture Time Limit: 2000/1000 MS (Java/Othe ...
- HDU 1234 (浙大计算机研究生复试上机考试-2005年) 开门人和关门人 (水)
开门人和关门人 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Su ...
- ZOJ问题(2010浙江大学研究生复试上机题目[找规律] hdoj 3788)
ZOJ问题 pid=3788">点击打开链接 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K ...
- 关键路径 p3 清华复试上机题
关键路径 p3 清华复试上机题 题目描述 小H为了完成一篇论文,一共要完成n个实验.其中第i个实验需要a[i]的时问去完成.小H可以同时进行若干实验,但存在一些实验,只有当它的若干前置实验完成时,才能 ...
- 九度OJ1486 /POJ 1029/2012北京大学研究生复试上机
wa到死!wa到死!这是一个看着简单,坑及其多的题! 坑一:POJ上是单组输入,九度上是多组输入,妈蛋要是研究生复试遇到这种大坑肯定死掉啊!而且对于codeforces比较习惯的 同学肯定会觉得巨坑无 ...
- Python数据分析与展示第3周学习笔记(北京理工大学 嵩天等)
入门学习马上结束辽. 1.Pandas库 import pandas as pd 两个数据类型:Series,DataFrame Series类型:数据+索引 自定义索引 b = pd.Series( ...
- python语言程序设计-北京理工大学-嵩天等课件代码整理
#TempConvert.py TempStr = input("请输入带有符号的温度值: ") if TempStr[-1] in ['F', 'f']: C = (eval(T ...
- 【4】【MOOC】Python游戏开发入门-北京理工大学【第三部分-游戏开发之机制(色彩与绘图)】
学习地址链接:http://www.icourse163.org/course/0809BIT021E-1001873001?utm_campaign=share&utm_medium=and ...
随机推荐
- spring学习笔记(七)HttpMessageConverter
spring学习笔记(七)HttpMessageConverter 1. HttpMessageConverter的加载 2. 从StringMessageConverter探究消息转换器的原理 1. ...
- 使用ramdisk启动ubuntu文件系统
环境 Qemu 4.1 vexpress-ca9 概述 为了减小linux内核的大小,可以把一些外设驱动编译成内核模块,但是在启动ubuntu的时候,需要读取flash,但是此时flash的驱动模块存 ...
- qt creator源码全方面分析(4-5)
目录 Qt中的字符串 QLatinString 详细介绍 源码 小结 QStringLiteral(str) 详细介绍 源码 小结 Qt中的字符串 Qt中处理字符串最常用的肯定是QString,但是在 ...
- Openwrt:基于MT7628/MT7688的PWM驱动
前言 MT7628/MT7688的PWM驱动相关资料较少,官方的datasheet基本也是一堆寄存器,啃了许久,终于嚼出了味道.由于PWM存在IO口复用的问题,所以要提前配置好GPIO的工作方式,不然 ...
- [hdu3336]kmp(后缀数组)
题意:求字符串s的所有前缀出现次数之和. http://www.cnblogs.com/jklongint/p/4446117.html 思路:用kmp做,简单且效率高.以前缀结尾的位置分类,令dp[ ...
- 宽字节XSS跨站攻击
简介 宽字节跨站漏洞多发生在GB系统编码. 对于GBK编码,字符是由两个字节构成,在%df遇到%5c时,由于%df的ascii大于128,所以会自动拼接%5c,吃掉反斜线.而%27 %20小于asci ...
- 新鲜出炉高仿网易云音乐 APP
我的引语 晚上好,我是吴小龙同学,我的公众号「一分钟GitHub」会推荐 GitHub 上好玩的项目,一分钟 get 一个优秀的开源项目,挖掘开源的价值,欢迎关注我. 项目中成长是最快的,如何成长,就 ...
- go 数组 字符串 切片
数组 数组定义方式 var a [3]int // 定义长度为3的int型数组, 元素全部为0 var b = [...]int{1, 2, 3} // 定义长度为3的int型数组, 元素为 1, 2 ...
- shrine
0x01 import flask import os app = flask.Flask(__name__) app.config['FLAG'] = os.environ.pop('FLAG') ...
- Millar Robin模板
\(Millar Robin\)模板 hdu2138 \(Code\) #include <cstdio> #include <iostream> #include <a ...