题意:求是n位且是t的倍数的数,如果没有输出-1
简单题,还是错了一次,忘了10是两位
详见代码
#include
#include
#include
using namespace std;
int main(void)
{
int n, t;
while(~scanf("%d%d", &n, &t))
{
int i;
if(n == 1 && t == 10)
{
printf("-1\n");
continue;
}
printf("%d", t%10==0?1:t);
for(i = 0; i < n-1; i++)
printf("0");
printf("\n");
}
return 0;
}