我需要将其转换为c ++或phyton [英] I need to convert this to c++ or phyton
本文介绍了我需要将其转换为c ++或phyton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
- static void 主要 ( string [] args )
- {
- string [] planet = new string 跨度> <跨度> [] {跨度> <跨度>"汞" 跨度> <跨度>,跨度>&NBSP; <跨度>"金星" 跨度> <跨度>, 跨度>&NBSP; <跨度>"地球QUOT; 跨度> <跨度>,跨度>&NBSP; <跨度>"火星" 跨度> <跨度>,跨度>&NBSP; <跨度>"木星" 跨度> <跨度>,跨度>&NBSP; <跨度>"土星" 跨度> <跨度>,跨度>&NBSP ; " Uranus" , " Neptune" };
- double [] 直径 <跨度> = 跨度>&NBSP; <跨度>新跨度>&NBSP; <跨度>双跨度> <跨度> [] 跨度>&NBSP; <跨度> {跨度>&NBSP; <跨度> 4879 跨度> <跨度>,跨度>&NBSP; <跨度> 12104 跨度> <跨度>,跨度>&NBSP; <跨度> 12756 跨度> <跨度>,跨度>&NBSP; <跨度> 6792 跨度> <跨度>,跨度>&NBSP; <跨度> 142984 跨度> <跨度>,跨度>&NBSP; <跨度> 120536 跨度> <跨度>, 51118 , 49528 };
- 控制台 。 WriteLine ( "每个星球其直径如下所示:" );
- ( int i = 0 跨度> <跨度>; 跨度> <跨度> I 跨度> <跨度>< 跨度> <跨度> 8 跨度> <跨度> 跨度> <跨度> I 跨度> <跨度style ="margin-bottom:0px"> ++)
- {
- 控制台 。 写 ( " \ nPlanet:" + planet [ i ]);
- 控制台 。 写 ( " \tDiameter:" + 直径 [ i ]);
- }
- 控制台 。 ReadLine ();
- }
- }
解决方案
Hello SLACA,
以下是植物例子。
planet = [" Mercury","Venus","Earth","Mars","Jupiter" ;,"土星","天王星","海王星"]
直径= [4879,12104,12756,6792,142984,120536,51118,49528]
print" \ n每个行星及其直径如下所示"
for i in range(0,8):
print" \ nPlanet:" + planet [i] +" \tDiameter:" + str(直径[i])
此致,
Neil Hu
- static void Main(string[] args)
- {
- string[] planet = new string[]{"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus","Neptune"};
- double[] diameter = new double[] { 4879, 12104, 12756, 6792, 142984, 120536, 51118, 49528 };
- Console.WriteLine("Each planet and its diameter are shown below:");
- for(int i=0;i<8;i++)
- {
- Console.Write("\nPlanet: "+planet[i]);
- Console.Write("\tDiameter: "+diameter[i]);
- }
- Console.ReadLine();
- }
- }
解决方案
Hello SLACA,
The following is phyton example.
planet =["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus","Neptune"] diameter = [4879, 12104, 12756, 6792, 142984, 120536, 51118, 49528] print "\nEach planet and its diameter are shown below" for i in range(0,8): print "\nPlanet: "+planet[i] +"\tDiameter: "+str(diameter[i])Sincerely,
Neil Hu
这篇关于我需要将其转换为c ++或phyton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文