#41743: ____


yp11351280@yphs.tp.edu.tw (710-43韓睿哲)

School : 臺北市私立延平高級中學
ID : 276272
IP address : [203.72.178.1]
Last Login :
2025-07-07 14:43:54
d570. 神龍見首不見尾 -- 板橋高中教學題 | From: [1.164.234.151] | Post Date : 2024-08-22 13:04

變數是否>0?是=>輸出=>換行=>將變數/10

                       否=>結束

#include <iostream>
using namespace std;
int main()
{
    int a;
    cin>>a;
    while(a){
        cout<<a<<endl;
        a/=10;
}
}

 
ZeroJudge Forum