|
|
вернуться в форумRe: Pascal VS C++ Shut up! Pascal Will Newer Die! Edited by author 18.10.2006 08:05 Re: Pascal vs C/C++ :( Послано hx 11 фев 2009 16:15 In C++ very hard syntax, and Pascal is good language too Re: Pascal vs C/C++ :( Currently I'm using C++ for solving problems, but can say: Pascal foreva! C++ has many drawbacks which are worse than just long "begin .. end" Re: Pascal vs C/C++ :( I solved problems using all languages available on this server and Java seems to be most convenient for me.. Re: +++ And why it is problem to solve it in Java? What we need for solution - just one array int[1000] But I really don't understand why timelimit is so small - memory is not crucial part of this problem at all... Re: +++ memory is not crucial part of this problem at all... Maybe author wanted to cut off DP way of solving this problem or something like this. Re: Pascal vs C/C++ :( #include <iostream> #include <stdio.h> using namespace std; int main() { int br[10024],i,m; double n,a; float sum; cin>>n>>a; sum=100/a; for(i=1;i<=10024;i++) { br[i]=0; } for(i=1;i<=a;i++) { cin>>m; br[m]++; } for(i=1;i<=n;i++) {
printf("%.2lf",(br[i]*sum)); cout<<"%"<<endl; } return 0; } Re: Pascal vs C/C++ :( Послано fallen 22 май 2009 17:46 Holywar on timus=). Lol. Re: Pascal vs C/C++ :( Can anyone translate my solution below into C++? I want to learn programming in C/C++ too :) type TArray=array of dword; var arr:TArray; m,n,c,i:dword; begin readln(n,m); setlength(arr,n+1); for i:=1 to n do arr[i]:=0; for i:=1 to m do begin readln(c); arr[c]+=1; end; for i:=1 to n do begin writeln((arr[i]*100/m):2:2,'%'); end; end. |
|
|