码迷,mamicode.com
首页 >  
搜索关键字:oj    ( 4253个结果
OJ刷题之《函数模板--求n个数之和》
题目描述 利用函数模板求4个数的和。 部分代码已给定如下,只需要提交缺失的代码。 #include using namespace std; /*   补充缺少代码 */ int main() {     double result;     unsigned char c1,c2,c3,c4;     cin>>c1>>c2>>c3>>c4;     result =...
分类:其他好文   时间:2014-12-27 11:27:43    阅读次数:133
[leetcode] Permutation Sequnce
原题地址:https://oj.leetcode.com/submissions/detail/5341904/题意:The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of ...
分类:其他好文   时间:2014-12-27 11:14:19    阅读次数:182
第18周OJ测试项目5--保密电文
某电报局的电文保密的规律是将每个英文字母变成其后的第4个字母(很原始的那种啦),如A变成E,a变成e。最后四个字母(W,X,Y,Z或w,x,y,z)又变成前4个字母(A,B,C,D或a,b,c,d).非字母字符不变。输入一行字母,要求输出对应的加密后的文字 。 代码如下: #include #include using namespace std; int main() { cha...
分类:其他好文   时间:2014-12-27 09:02:32    阅读次数:168
【原创】leetCodeOj --- Excel Sheet Column Title 解题报告
题目地址:https://oj.leetcode.com/problems/excel-sheet-column-title/题目内容:Given a positive integer, return its corresponding column title as appear in an Ex...
分类:其他好文   时间:2014-12-27 06:44:00    阅读次数:152
leetcode 【 Reverse Words in a String 】python 实现
题目:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".代码:oj在线测试通过Runtime:172 ms 1...
分类:编程语言   时间:2014-12-27 01:26:47    阅读次数:232
18周OJ测试项目1--百位数答应了
m是个三位的整数,家里出了点小麻烦。个位数和十位数一直对百位数凡事都先露脸心怀不满,想出个办法,联手向百位数发起挑点。他们两个先相加,再减去百位数,以相减结果得到正值为傲。大度的百位数答应了:不就是陪着这两个无聊的家伙解闷嘛。请你编程序,帮他们一比高低。 代码如下: #include using namespace std; int main( ) { int m, a, b...
分类:其他好文   时间:2014-12-26 23:03:30    阅读次数:369
第18周OJ测试项目2--关灯
输入n(1~500)盏灯并编号,输入1~9(包含1和9)的数字m,灭掉编号中带m的数及m倍数的灯,最后输出亮出的灯的编号。 代码如下 #include using namespace std; int main() { int m,n,i; cin>>n>>m; for(i=1; i<n; ++i) { if ((i%m!=0)&&(i%10!...
分类:其他好文   时间:2014-12-26 23:03:26    阅读次数:360
第18周OJ测试项目3--数组成绩统计
定义一个5行3列的二维数组,各行分别代表一名学生的高数、英语、C++成绩。再定义一个有5个元素的一维数组,用于存储每名学生的平均成绩。请输入学生的各门课成绩,输出带平均成绩的成绩单,以及所有学生平均成绩的平均值。 代码如下: #include #include using namespace std; int main() { int score[5][3]; double ...
分类:编程语言   时间:2014-12-26 23:00:46    阅读次数:186
第18周OJ测试项目4--找出素数
输入若干个正整数,将其中的素数输出来。 代码如下: #include #include using namespace std; bool isPrime(int n); int main( ) { int n; while(cin>>n) { if(isPrime(n)) cout<<n<<endl; } r...
分类:其他好文   时间:2014-12-26 22:59:46    阅读次数:208
第18周OJ测试项目6--用数字造数字
输入一个3位以上的整数,求其中最大的两个数字之和与最小的数字之和之间的差。例如:输入8729,输出8,即(9+8)-(2+7)=8,再如,输入24825,输出9,即(8+5)-(2+2)=9。 代码如下: #include using namespace std; int main() { int str[10]; int i = 0, n, m, j, t; cin >> n; d...
分类:其他好文   时间:2014-12-26 22:59:42    阅读次数:192
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!