Gena ' s Code
It's the year 4527 and the tanks game, we all know, and love still exists. There also exists great Gena ' s code, written in 2016. The problem this code solves is:given the number of tanks that go to the battle from each country, find their product. If It is turns to being too large, then the servers might has not enough time to assign tanks into teams and the whole game Would collapse!
There is exactly n distinct countries in the world and the i -th Country added a I tanks to the game. As the developers of the game was perfectionists, the number of tanks from each country is beautiful. A beautiful number, according to the developers, was such number that its decimal represent ation consists only of digits ' 1 ' and ' 0 ', moreover it Contains at most one digit ' 1 '. However, due to complaints from players, some number of tanks of one country was removed F Rom the game, hence the number of tanks of this country is not remain beautiful.
Your task is to write the program, solves exactly the same problem in order to verify Gena ' s code correctness. Just in case.
Input
The first line of the input contains the number of countries n (1≤ n ≤100 000). The second line contains n non-negative integers ai without leading zeroes-the nu Mber of tanks of the I-th country.
It is guaranteed that the second line contains at least n -1 beautiful numbers and the total length of Al L These number ' s representations doesn ' t exceed .
Output
Print a single number without leading zeroes-the product of the number of tanks presented by each country.
Examplesinput
3
5 10 1
Output
50
Input
4
1 1 10 11
Output
110
Input
5
0 3 1) 100 1
Output
0
Note
In Sample 1 numbers and 1 am beautiful, number 5 is not not.
In Sample 2 number one is not beautiful (contains-1 ' s), all others is beautiful.
In the sample 3 number 3 is not beautiful, and all others is beautiful.
Problem reading: Large number of problems, multiplication of large numbers (beautiful number);
#include <cstdio>#include<cstring>#include<iostream>using namespaceStdintcount;BOOLDealChar*str) { intb=0, c=0; intlen=strlen (str); for(intI=0; i<len; i++) { if(Str[i]! ='0'&& Str[i]! ='1') { return true; } if(str[i]=='0') b++; if(str[i]=='1') C + +; } if(c>1)return true; Count+=b; return false;}intMain () {intT; while(SCANF ("%d", &t)! =EOF) { BOOLflag=0, istrue=false;Charfirnum[100010]; Count=0; while(t--) { Charstr[100010]; Cin>>str; if(strlen (str) = =1&& str[0]=='0') flag=1; if(Deal (str) &&!flag) {IsTrue=true; strcpy (Firnum, str); } } if(flag) {printf ("0\n"); Continue; } if(istrue==0) printf ("1"); Elseprintf ("%s", Firnum); for(intI=0; i< count; i++) printf ("0"); printf ("\ n"); } return 0; }
Gena ' s Code