模拟 URAL 1149 Sinus Dances
/*
模拟:找到规律分别输出就可以了,简单但是蛮有意思的
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
using namespace std; const int MAXN = 2e2 + ;
const int INF = 0x3f3f3f3f; void print_An(int n)
{
for (int i=; i<=n; ++i)
{
printf ("sin(%d", i);
if (i < n) printf ("%c", (i&) ? '-' : '+');
} for (int i=; i<=n; ++i) printf ("%c", ')');
} void work(int n)
{
for (int i=; i<n; ++i) printf ("%c", '(');
print_An (); printf ("%c%d", '+', n);
for (int i=n-, j=; i>=; --i)
{
printf ("%c", ')'); print_An (++j);
printf ("%c%d", '+', i);
}
puts ("");
} int main(void) //URAL 1149 Sinus Dances
{
// freopen ("F.in", "r", stdin); int n;
while (scanf ("%d", &n) == )
{
work (n);
} return ;
}
模拟 URAL 1149 Sinus Dances的更多相关文章
- Ural 1149 - Sinus Dances
Let An = sin(1–sin(2+sin(3–sin(4+…sin(n))…)Let Sn = (…(A1+n)A2+n–1)A3+…+2)An+1For given N print SN I ...
- Timus 1149. Sinus Dances 打印复杂公式
就是打印以下这两个复杂的式子: Let An = sin(1–sin(2+sin(3–sin(4+-sin(n))-) Let Sn = (-(A1+n)A2+n–1)A3+-+2)An+1 For ...
- 杭电ACM分类
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- URAL 2046 A - The First Day at School 模拟题
A - The First Day at SchoolTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudg ...
- URAL 1404. Easy to Hack! (模拟)
space=1&num=1404">1404. Easy to Hack! Time limit: 1.0 second Memory limit: 64 MB When Vi ...
- URAL 1993 This cheeseburger you don't need 模拟题
This cheeseburger you don't need 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=1993 Descrip ...
- ural 2020 Traffic Jam in Flower Town(模拟)
2020. Traffic Jam in Flower Town Time limit: 1.0 secondMemory limit: 64 MB Having returned from Sun ...
- ural 2015 Zhenya moves from the dormitory(模拟)
2015. Zhenya moves from the dormitory Time limit: 1.0 secondMemory limit: 64 MB After moving from hi ...
随机推荐
- msp430入门学习20
msp430的USART模式 msp430入门学习
- [bzoj1895][Pku3580]supermemo_非旋转Treap
supermemo bzoj-1895 Pku-3580 题目大意:给定一个n个数的序列,需支持:区间加,区间翻转,区间平移,单点插入,单点删除,查询区间最小值. 注释:$1\le n\le 6.1\ ...
- 洛谷 P1018 乘积最大
P1018 乘积最大 题目描述 今年是国际数学联盟确定的“ 20002000 ――世界数学年”,又恰逢我国著名数学家华罗庚先生诞辰 9090 周年.在华罗庚先生的家乡江苏金坛,组织了一场别开生面的数学 ...
- CSS3的animation功能
旋转动画 <img src="https://facebook.github.io/react/img/logo.svg" class="App-logo" ...
- Django学习系列之ORM-QuerySetAPI
基本操作 # 增 models.Tb1.objects.create(c1='xx', c2='oo') #增加一条数据,可以接受字典类型数据 **kwargs obj = models.Tb1(c1 ...
- Dell PowerEdgeServerT110II USB Boot更新
可引导USB设备更新Dell PowerEdge服务器 当显示Boot Options(“启动选项”)时,选择option 1(选项 1)以开始固件更新. 现在正在加载的Linux发行版本 然后固件更 ...
- UML基础与应用总结
敲响一段键盘的乐响曲,一段路程留下一些足迹. UML.是Unified-Modeling-Language的缩写. 首先要明白知道它是一种可视化的建模语言. 什么是UML基 ...
- Num 15: NYOJ: 题目0002 : 括号配对问题 [ 栈(stack) ]
原题连接 首先要了解有关栈的一些基本知识,即: 什么是栈,栈有什么作用: 1.什么是栈: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkb ...
- 【iOS开发-74】解决方式:Xcode6下利用preference保存数据,终于的plist文件在哪里?
(1)现象:普通情况下.储存数据以一个沙盒为单位,preference数据存在在沙盒路径下Library/Preferences里面,可是Xcode6里找来找去根本什么都没有. watermark/2 ...
- MariaDB ----单表查询
1>按一定条件查询某字段的数据 (where) ; ( 查询 id > 的数据) #补充: ; 注意“ select * from students1: (此命令需谨慎使用, 数据量大 ...