02.26 NOIP-1003猜數遊戲

題目:


NOIP-1003猜數遊戲

1003題目描述


代碼:

<code>#include<iostream>using namespace std;int main(){int a,num,res;cin>>a;num = a*1000+a;res = num/7/11/13;cout</<iostream>/<code>

思路:

  1. 輸入一個數ABC,因為說了100~999,所以整形數字就好;
  2. 構造ABCABC;
  3. 分別除以7,11,13;
  4. 輸出結果

填坑1:構造ABCABC

因為輸入的是3位數,要構造成6位數,需要進位1000.

<code>num = a*1000+a;/<code>


分享到:


相關文章: