1610.cpp

来自「这是哈尔滨工业大学acmOJ的源代码」· C++ 代码 · 共 25 行

CPP
25
字号
/*  This Code is Submitted by wywcgs for Problem 1610 on 2005-03-13 at 08:38:49 */ 
#include <stdio.h>

int main()
{
    long N, temp, a;
    int K, M;

    while(scanf("%d %ld", &K, &N) == 2){
        if((N == 0) && (K == 0)){
            return 0;
        }else if(N <= K){
            printf("%ld items, %d answers per question, 1 question\n", N, K);
        }else{
            temp = 1;
            a = N / K;
            for(M = 2; temp < a; M++){
                temp *= K;
            }
            printf("%ld items, %d answers per question, %d questions\n", N, K, M);
        }
    }

    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?