C 學習總結

2021-04-13 00:49:47 字數 2213 閱讀 9652

using system;

using system.collections.generic;

using system.text;

namespace helloworld

class fraction

class program

console.writeline("", sum);

}private static void testwhiledo()

while (i < 10);

console.writeline("", sum);

}private static void testfor()

console.writeline("", sum);

}private static void testhelloworld()

private static void teststruct()

/", h.numerator, h.denominator);

}private static void testclass()

/", h.numerator, h.denominator);

}private static void testcal()

", i);

console.writeline("true && false:", true && false);

console.writeline("true || false:", true || false);

int j = 0x000f0005, k = 0x00f0f003;

console.writeline("j = 0x,k = 0x", j, k);

console.writeline("j = 0x,k = 0x", ~j, ~k);

console.writeline("j&k = 0x", j & k);

console.writeline("j|k = 0x", j | k);

console.writeline("j^k = 0x", j ^ k);

console.writeline("17+5=/r/n17-5=/r/n17*5=/r/n17/5=/r/n17%5=", 17 + 5, 17 - 5, 17 * 5, 17 / 5, 17 % 5);

console.writeline("17 > 5=/r/n17>=5=/r/n17<5=/r/n17<=5=/r/n17==5=/r/n17!=5=", 17 > 5, 17 >= 5, 17 < 5, 17 <= 5, 17 == 5, 17 != 5);

console.writeline("2<<2=", 2 << 1);

}private static void testbasictype()

", x);

console.writeline("y = ", y);

x++;

y++;

console.writeline("x = ", x);

console.writeline("y = ", y);

x++;

y++;

console.writeline("x = ", x);

console.writeline("y = ", y);

bool a = true;

bool b = false;

console.writeline("a = ", a);

console.writeline("b = ", b);

float c = 3.1415926f;

double d = 3.141519253579;

console.writeline("c = ", c);

console.writeline("d = ", d);

c = (float)d;

console.writeline("c = ", c);

decimal e = 1.23567894566m;

e *= 2;

console.writeline("e = ", e);

char f = '我';

char g = 'a';

console.writeline("f = ", f);

console.writeline("g = ", g);}}

private static void testifelse()

else if (imark >= 85)

else}}

}

C 學習總結( )

1 based code 是為了向後相容用的。2 mfc提供的由cdialog派生的類 derived dialog class purpose ccolordialog 選擇顏色 cfiledialog 選擇檔名以開啟或儲存 cfindreplacedialog 查詢或替換對話方塊 cfontdi...

C 學習總結

用一段 來表示的話就是這樣了 void main int date 1 while date 17 cout 第 這種教學方式,在讓自己增長知識的同時還考驗著乙個人對堅持做一件事的決心和毅力。相對於前者來說,我感覺在社會中後者的作用可能會更大吧。現在我發現部落格對我的吸引力更大了,當看到自己的十分用...

C 學習總結

函式 convert.toint32 把使用者輸入的資料轉換為 int 資料型別,因為 console.readline 只接受字串格式的資料。字尾u 和 l 分別表示 unsigned 和 long。b退格鍵 字元 obsolete don t use oldmethod,use newmetho...