Ai giúp em chuyển bài code pascal này sang C++ với ạ. uses crt; var d,g:text; m,s:real; x,y:array[1..10000000]of longint; n,i,j,vt:longint; begin clrscr; assign(d,’input.pas’);reset(d); assign(g,’output.pas’);rewrite(g); readln(d,n); for i:=1 to n do read(d,x[i],y[i]); for i:=1 to n do begin s:=0; for j:=1 to n do s:=s+sqrt(sqr(x[j]-x[i])+sqr(y[j]-y[i])); if s>m then begin vt:=i; m:=s; end; end; writeln(g,vt,’ ‘,m:0:3); close(g); close(d); end. Em cảm ơn

Các câu hỏi liên quan

1. Samuel started keeping a diary in 1997. → Samuel has ………………………………………………… 2. We started learning English five years ago. → We have ………………………………………………… 3. I began living in Ho Chi Minh City when I was 8. → I have ………………………………………………… 4. She has taught the children in this remote village for five months. → She started………………………………………………… 5. He has written to me since April. → The last time………………………………………………… 6. She hasn’t had a swim for five years. → She last ………………………………………………… 7. They last talked to each other two months ago. → They haven’t………………………………………………… 8. The last time she saw her elder sister was in 1999. → She hasn’t ………………………………………………… 9. She hasn’t written to me for years. → It’s years………………………………………………… 10. Robert and Catherine have been married for ten ỵears. → It’s ten years ………………………………………………… 11. It’s two weeks since they cleaned their room. → They………………………………………………… 12. It’s over six months since John had his hair cut. → John ………………………………………………… 13. How long is it since you rode a bicycle? → When ………………………………………………… 14. How long is it since he wrote to you? → When………………………………………………… 15. When did he last talk to you? → How long ………………………………………………… 16. When did you last telephone him? → Hong long ………………………………………………… 17. We have never eaten this kind of food before. → It’s the ………………………………………………… 18. This is the first time I have seen this film. → I have never………………………………………………… 19. This is the first time he went abroad. → He hasn’t ………………………………………………… 20. She started driving 1 month ago. → She has ………………………………………………… 21. We began eating when it started to rain. → We have ………………………………………………… 22. I last had my hair cut when I left her. → I haven’t ………………………………………………… 23. The last time she kissed me was 5 months ago. → She hasn’t………………………………………………… 24. It is a long time since we last met. → We haven’t………………………………………………… 25. When did you have it ? → How long………………………………………………… 26. This is the first time I had such a delicious meal . → I haven’t………………………………………………… 27. I haven’t seen him for 8 days. → The last………………………………………………… 28. I haven’t taken a bath since Monday. → It is………………………………………………… 29. It's 2 years since I had a future. → I have ………………………………………………… 30. It's 2 months since he earned any money. → He has ………………………………………………… 31. He last shaved the day before yesterday. → He hasn’t ………………………………………………… 32. I last drank champagne at my brother's wedding. → I haven’t ………………………………………………… 33. It's 2 years since I was last in Rome. → I haven’t………………………………………………… 34. I saw Tom last on his wedding day. 35. I last ate raw fish when I was in Japan. → I haven’t ………………………………………………… 36. It's years since Mary last spoke French. → Mary hasn’t………………………………………………… 37. It's ten weeks since since I last had a good night sleep. → I haven’t………………………………………………… 38. He last paid taxes in 1970. → He hasn’t………………………………………………… 39. I last ate meat 5 years ago. → I haven’t………………………………………………… 40. It's 3 months since since the windows were cleaned. → The windows haven’t ………………………………………………… 41. It's years since I took photographs. → I haven’t ………………………………………………… 42. I last watched TV on new year's day. → I haven’t ………………………………………………… 43. It's 3 months since he wrote to me. → He hasn’t ………………………………………………… 44. The last time I was aboard was in the summer of 1978. → I haven’t ………………………………………………… 45. It's ten years since that house was lived in. → That house ………………………………………………… 46. I haven't seen him for 2 months. → I last ………………………………………………… 47. I haven't been to a concert for over a year. → The last time ………………………………………………… 48. The last time I really enjoyed myself was your birthday party. → I haven’t ………………………………………………… 49. It;s nearly 20 years since my father saw his brother. → My father hasn’t…………………………………………………