C_ʹÓÃswitchÓï¾ä
Ô´Âë:
# include <stdio.h>
int main()
{
int num;
/* ÏÂÃ涨ÒåµÄ¸÷±äÁ¿£¬·Ö±ð´ú±í¸öλ£¬Ê®Î»£¬°Ùλ£¬Ç§Î»£¬Íòλ£¬Ê®ÍòλÒÔ¼°Î»Êý */
int indiv, ten, hundred, thousand;
int ten_thousand, hundred_thousand, place;
printf("ÇëÊäÈëÒ»¸öÕûÊý(0¡«999999)£º");
scanf("%d", &num);
/* ÅжϱäÁ¿numµÄλÊý */
if(num > 99999)
place = 6;
else if(num > 9999)
place = 5;
else if(num > 999)
place = 4;
else if(num > 99)
place = 3;
else if(num > 9)
place = 2;
else
place = 1;
printf("place = %d\n", place);
printf("ÿλÊý×ÖΪ£º");
/* Çó³önumÔÚ¸÷λÉϵÄÖµ */
hundred_thousand = num/100000;
ten_thousand = (num - hundred_thousand*100000)/10000;
thousand = (num - hundred_thousand*100000 - ten_thousand*10000)/1000;
hundred = (num - hundred_thousand*100000 - ten_thousand*10000
- thousand*1000)/100;
ten = (num - hundred_thousand*100000 - ten_thousand*10000
- thousand*1000 - hundred*100)/10;
indiv = num - hundred_thousand*100000 - ten_thousand*10000
- thousand*1000 - hundred*100 - ten*10;
/* Åжϱä
Ïà¹ØÎĵµ£º
b/s ÊÇ brower/server ¾ÍÊÇÓÃä¯ÀÀÆ÷(Èçie)ΪӦÓóÌÐò¿Í»§¶Ë²Ù×÷·þÎñÆ÷¡£ÕâÑùÓÃä¯ÀÀÆ÷À´²Ù×÷¼òµ¥Ò×Ó㬵«ÊǶÔÊäÈëûÓкܺõÄÑéÖ¤¡£Â߼ʵÏÖ²»¶à¡£±¾µØÖ»ÊÇÓÃÓÚ»ñÈ¡Êý¾ÝÈ»ºó´ó²¿·ÖÑéÖ¤ÐèÒªÌá½»·þÎñÆ÷À´Íê³É¡£
c/s ÊÇclient/server ¿Í»§¶ËÈí¼þÔòÊÇÒ»¸öÓµÓкܶàÂß¼ÑéÖ¤µÄÈí¼þ£¬±¾µØÑéÖ¤³É¹¦ºó²ÅÌá½»·þÎñÆ÷¡£
ÎÒÕÒµ½µÄ¸ ......
C#´ÓJava¼Ì³Ð¶øÀ´µÄÌصã
¡¡¡¡Àà:ÔÚC#ÖÐÀàµÄÉêÃ÷ÓëJavaºÜÏàËÆ.ÕâÊǺÏÀíµÄÒòΪ¾Ñé¸æËßÎÒÃÇJavaÄ£Ð͹¤×÷µÃºÜºÃ.JavaµÄ¹Ø¼ü×ÖimportÒѾ±»Ìæ»»³Éusing,ËüÆðµ½ÁËͬÑùµÄ×÷ÓÃ.Ò»¸öÀ࿪ʼִÐеÄÆðµãÊǾ²Ì¬·½·¨Main().ÏÂÃæµÄHello World³ÌÐòչʾÁË»ù±¾µÄÐÎʽ:
¡¡¡¡using System;
¡¡¡¡class Hello
¡¡¡¡{
¡¡¡¡static v ......
Ìá³öÎÊÌ⣺
»Øµ÷º¯ÊýÊÇ»ùÓÚC±à³ÌµÄWindows SDKµÄ¼¼Êõ£¬²»ÊÇÕë¶ÔC++µÄ£¬³ÌÐòÔ±¿ÉÒÔ½«Ò»¸öCº¯ÊýÖ±½Ó×÷Ϊ»Øµ÷º¯Êý£¬µ«ÊÇÈç¹ûÊÔͼֱ½ÓʹÓÃC++µÄ³ÉÔ±º¯Êý×÷Ϊ»Øµ÷º¯Êý½«·¢Éú´íÎó£¬ÉõÖÁ±àÒë¾Í²»ÄÜͨ¹ý¡£
·ÖÎöÔÒò£º
ÆÕͨµÄC++³ÉÔ±º¯Êý¶¼Òþº¬ÁËÒ»¸ö´«µÝº¯Êý×÷Ϊ²ÎÊý£¬Ò༴“this”Ö¸Õ룬C++ͨ¹ý´«µÝÒ»¸öÖ¸Ïò×ÔÉíµÄÖ¸ ......
Ô´Âë:
# include <stdio.h>
int main()
{
/* ¶¨ÒåÒ»¸öÕûÊýÀàÐ͵ıäÁ¿£¬ÓÃÀ´´æ·ÅºóÃæËãʽµÄÖµ */
int logic;
int a = 1;
int b = 2;
int c = 3;
&n ......
Ô´Âë:
# include <stdio.h>
int main()
{
int i, j, k;
int m, n, p;
i = 8;
j = 10;
k = 12;
/* ×ÔÔöÔÚ²Ù×÷Êý֮ǰ */
  ......