diff --git a/万维调考试题/Prog2.c b/万维调考试题/Prog2.c new file mode 100644 index 0000000..60accbd --- /dev/null +++ b/万维调考试题/Prog2.c @@ -0,0 +1,34 @@ + +/*---------------------------------------------------------------------- +¡¾³ÌÐòÉè¼Æ¡¿ +------------------------------------------------------------------------ +ÉúÎïѧ¼ÒÑо¿·¢ÏÖij΢ÉúÎïϸ°ûÿ2Сʱ·ÖÁÑÒ»´Î£¨1±ä2£©£¬ÏÖÔÚÅàÑøÃó·Å1¸öϸ°û£¬NСʱºóÅàÑøÃóÖÐÓжàÉÙϸ°û£¿ +ÍêÉÆÒÔϳÌÐòÒÔЭÖúÉúÎïѧ¼Ò¼ÆËã3Сʱ¡¢5Сʱ¡¢6Сʱºó·ÖÁѵÄϸ°ûÊýÄ¿¡£ +£¨ÒªÇóÓõݹéʵÏÖ£© +ÀýÈ磺 +3Сʱºó£º2¸ö +5Сʱºó£º4¸ö +6Сʱºó£º8¸ö +------------------------------------------------------------------------ +×¢Ò⣺²¿·ÖÔ´³ÌÐò¸ø³öÈçÏ¡£ÇëÎð¸Ä¶¯Ö÷º¯Êýmain»òÆäËüº¯ÊýÖиø³öµÄÄÚÈÝ£¬½öÔÚ + Program-EndÖ®¼äÌîÈëÈô¸ÉÓï¾ä¡£ + ²»ÒªÉ¾³ý±êÖ¾·ñÔò²»µÃ·Ö¡£ + ²»ÒªÐ޸Ļòɾ³ýProgram-EndÖ®ÍâµÄÄÚÈÝ·ñÔò²»µÃ·Ö¡£ +----------------------------------------------------------------------*/ + +#include +int split(int hours) +{ +/**********Program**********/ + return hours<=1?1:split(hours-2)*2; +/********** End **********/ +} + +int main() { + + int hour; + printf("ÇëÊäÈëСʱ£º"); + scanf("%d",&hour); + printf("%dСʱºó£º%d¸ö\n",hour, split(hour)); + return 0; +}