cf584a(水题)

题意是输出一个能被t整除的n位数。。。

思路很简单,输出t和n-1个0即可。当然,还需要特判一下t为1,n为10的情况。。

代码如下:

 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 
 4 int main(void)
 5 {
 6     int n, t;
 7     cin >> n >> t;
 8     if(n==1 && t==10)
 9     {
10         cout << "-1" << endl;
11         return 0;
12     }
13     cout << t;
14     n--;
15     while(n--)
16     {
17         cout << "0";
18     }
19     cout << endl;
20     return 0;
21 }

 



posted @ 2016-08-07 09:57  geloutingyu  阅读(132)  评论(0编辑  收藏  举报