zrq495
www.zrq495.com
上一页 1 ··· 3 4 5 6 7
摘要: In this problem you are to generate a triangular wave form according to a specified pair of Amplitude and Frequency.Input and OutputThe input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed 阅读全文
posted @ 2012-05-21 20:22 zrq495 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Your mission, if you decide to accept it, is to create a maze drawing program. A maze will consist of the alphabetic characters A-Z, * (asterisk), and spaces.Input and OutputYour program will get the information for the mazes from the input file. This file will contain lines of characters which your 阅读全文
posted @ 2012-05-21 19:46 zrq495 阅读(182) 评论(0) 推荐(0) 编辑
摘要: An imaging device furnishes digital images of two machined surfaces that eventually will be assembled in contact with each other. The roughness of this final contact is to be estimated.A digital image is composed of the two characters, "X" and " " (space). There are always 25 col 阅读全文
posted @ 2012-05-20 19:28 zrq495 阅读(12490) 评论(0) 推荐(0) 编辑
摘要: Everybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!''Now, could someone tell me how many words I just said?Input and OutputInput to your program will consist of a series of lines, each line containing multiple words (at least one). A ``word'' is d 阅读全文
posted @ 2012-05-20 11:16 zrq495 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Write a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded set of characters and print the exact message that the characters contain. The code key for this simple coding is a one for one character substitution 阅读全文
posted @ 2012-05-20 10:53 zrq495 阅读(131) 评论(0) 推荐(0) 编辑
摘要: German farmers are given a premium depending on the conditions at their farmyard. Imagine the following simplified regulation: you know the size of each farmer's farmyard in square meters and the number of animals living at it. We won't make a difference between different animals, although t 阅读全文
posted @ 2012-05-20 09:49 zrq495 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 很水的题,但是交了很多次都WA了,纠结啊。后来把输入输出格式该了才对。。。。The ProblemHave you ever played Minesweeper? It's a cute little game which comes within a certain Operating System which name we can't really remember. Well, the goal of the game is to find where are all the mines within a MxN field. To help you, the gam 阅读全文
posted @ 2012-05-19 20:08 zrq495 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 int main() 3 { 4 int n, m, count, max, i, j; 5 while(scanf("%d%d", &n, &m)!=EOF) 6 { 7 printf("%d %d ", n, m); 8 max=1; 9 if (n > m)10 {11 n=n+m;12 m=n-m;13 n=n-m;14 }15 for (i=n; i... 阅读全文
posted @ 2012-05-19 11:02 zrq495 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 每四个一循环一次。 1 #include<iostream.h> 2 using namespace std; 3 int main() 4 { 5 int n; 6 while(cin>>n) 7 { 8 if (n%4 == 2) 9 cout<<"yes"<<endl;10 else11 cout<<"no"<<endl;12 }13 return 0;14 } 阅读全文
posted @ 2012-02-26 11:13 zrq495 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe 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 contains two or more digits, those digits are summed and the process is repeated. This is cont 阅读全文
posted @ 2012-02-26 10:26 zrq495 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 水题~Problem DescriptionA simple mathematical formula for e iswhere n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.OutputOutput the approximations of e generated by the above formula for the values of n from 0 to 9. The begi 阅读全文
posted @ 2012-02-25 20:57 zrq495 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).InputThe input consists of multiple test cases. Each test case contains 3 integers A, B and n on a single line (1 <= 阅读全文
posted @ 2012-02-25 20:39 zrq495 阅读(175) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7