.
sum/=n;
for(i=0;i
Console.write( a[i] + ¡° ¡° );
Console.writeLine (); }
´ð°¸£ºÏÔʾÊä³öÊý×éaÓÚµÈÓÚÆ½¾ùÖµµÄËùÓÐÔªËØÖµ¡£
6£®Ð´³öÒÔϳÌÐòÔËÐнá¹û¡£ using System; class Test {
const int N=5;
public static void Main (){ int a = 0;
for(int i=1; i . . int c=0, b=2; a+=3; c=a+b; Console.write (c + ¡° ¡° ); } } ´ð°¸£º5 8 11 14 7. д³öÒÔϳÌÐòÔËÐнá¹û¡£ using System; class Test { static void LE(ref int a, ref int b) { int x = a; a = b; b = x; Console.writeLine (a + ¡° ¡° +b); } public static void Main () . . { int x=10, y=25; LE(ref x, ref y); Console.writeLine (x + ¡° ¡° +y); } } ´ð°¸£º25 10 25 10 8£®Ð´³öÒÔϳÌÐòµÄ¹¦ÄÜ¡£ static void WA(ref int[] a, int n) { for(int i=0;i for(int j=i+1;j int x=a[i]; a[i]=a[k]; a[k]=x; } } . . ´ð°¸£º²ÉÓÃÑ¡ÔñÅÅÐòµÄ·½·¨¶ÔÊý×éaÖеÄn¸öÕûÊý°´ÕÕ´ÓСµ½´óµÄ´ÎÐòÖØÐÂÅÅÁС£ 9. д³öÒÔϳÌÐòµÄÔËÐнá¹û¡£ using System; class Test { public static void Main () { int[ ] a ={2,4,6,8,10,12,14,16,18}; for (int i=0; i<9; i++) { Console.write(¡° ¡±+a[i]); if ((i+1)%3==0) Console.writeLine(); } } } ´ð°¸£º2 4 6 . . 8 10 12 14 16 18 10. д³öÒÔϳÌÐòÔËÐнá¹û¡£ using System; class Test { public static void Main () { int s=0; for (int i=1; ; i++) { if (s>50) break; if (i%2==0) s+=i; } Console.writeLine (\s); } } ´ð°¸£ºi,s = 15, 56 .
Ïà¹ØÍÆ¼ö£º