Loop-07. Crawling worms, loop-07 crawling worms

Source: Internet
Author: User

Loop-07. Crawling worms, loop-07 crawling worms

1/* 2 * Main. c 3 * C7-cycle-07. crawling worm 4 * Created on: July 26, 2014 5 * Author: Boomkeeper 6 ***** passed the test ********* 7 */8 9 # include <stdio. h> 10 11 int main (void) {12 int n, u, d; // wellhead height, climbing and descent 13 int time = 0, distance = 0; // time consumed by insects (minutes), 14 scanf ("% I", & n, & u, & d) from the bottom hole ); 15/** 16 * 1st minutes, crawler; 17 * 2nd minutes, slide; 18 * 3rd minutes, crawler; 19 * 4th minutes, slide; 20 *... 21 * The time is an even number, and the worm falls down. 22 * The time is an odd number, and the worm climbs up. 23 */24 do {25 time ++; 26 if (time % 2! = 0) {27 distance + = u; 28} else {29 distance-= d; 30} 31} while (distance <n ); 32 33 printf ("% I \ n", time); 34 35 return 0; 36}

I am confused about this question: "How long does it take for a worm to climb up ?", I checked N times carefully and did not find any clear explanation. However, after seeing the program of the following prawns, I can only admit that "Every minute!

If this question appears in the test room, I will be entangled...

Refer:

Http://blog.csdn.net/weixin_sysu/article/details/38051269

Question link:

Http://pat.zju.edu.cn/contests/basic-programming/%E5%BE%AA%E7%8E%AF-07


There are always worms invading the computer, and every time they are the same worms

Similarly, we recommend that you download the all-functional security software of Kaspersky, which ranks first in the world in anti-virus mode. Then, in security mode, Windows will automatically disable unnecessary startup, and the virus will not start automatically, you can easily scan and kill! It can be solved in general. If it is not possible to restore the system with one click, I do not recommend reinstalling the system, it will damage the hard disk, it is not recommended to reinstall the system without a break!

Is worm an anaerobic creature? (Problems involved in a biological question)

Worms are commonly known as flat animals, link animals, neighborhood animals, spike animals, and bag-shaped animals. They are not a creature, but a type of animals. It is just a habit to become a worm.
Not anaerobic

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.