
语言入门篇
文章平均质量分 68
小小海豚
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
nyoj—1的个数
1的个数_进制转换问题输入第一行输入一个整数N,表示测试数据的组数(1每组测试数据只有一行,是一个整数M(0=输出每组测试输出占一行,输出M的二进制表示中1的个数样例输入3467样例输出123题意:把N转换成二进制,求其中1的个数。某大神的代码: #includeint count1(int num){ int i=0; whi原创 2014-03-12 13:36:33 · 510 阅读 · 0 评论 -
oj-3rd__阿尔法星距离
阿尔法星距离阿尔法距离就是从两个单词中能取走最少字符的数目,使剩下的部分属于阿尔法单词组。比如单词sleep和leap,如果我们从sleep中取走s和e,从leap中取走a,那么剩余的部分就属于阿尔法单词组了,因为两个单词只剩下了lep,那么这两个单词的阿尔法距离就是3。同样的cat和dog,因为其中没有共同的字母,所以只能取走所有的字符(两个空单词默认属于阿尔法单词组),阿尔法距离就原创 2014-03-14 11:02:31 · 898 阅读 · 0 评论 -
C++中的控制函数
#include io代表输入输出,manip是manipulator(操纵器)的缩写(在c++上只能通过输入缩写才有效。)转载 2014-05-04 14:13:31 · 772 阅读 · 0 评论 -
全部合法顺序——对栈和队列的应用
全部合法顺序 ——对栈和队列的应用大家还记得判断出栈顺序是否合法那道题吗。。。现在拓展一下,题目要求输入n,并且输出它出栈的所有合法排序。。。#includeusing namespace st原创 2014-03-17 16:30:59 · 643 阅读 · 0 评论 -
cin ,scanf()和getchar()的用法
那些题的输入语句还记得cin,scanf()和getchar()的区别吗?下面先来个程序,运行一下:#include#includeusing namespace std;int main(){ char n,m; cin>>n>>m; printf("%d%d",n,m); return 0;}#include#includeusing namespace原创 2014-03-06 20:37:54 · 1134 阅读 · 0 评论 -
Digital Roots——ZOJ 1115
BackgroundThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value原创 2014-07-17 16:01:43 · 466 阅读 · 0 评论 -
hartals——UVA 10050
A social research organization has determined a simple set of parameters to simulate the behavior of the political parties of our country. One of the parameters is a positive integer h (called the原创 2014-07-17 16:57:53 · 517 阅读 · 0 评论