Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C_ʹÓÃforÑ­»·»­ÁâÐÎ

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    int i, j, k;
     
    /* ±äÁ¿i´Ó0µ½4£¬±íʾËù»­ÁâÐÎͼµÄµÚÒ»ÖÁµÚÎåÐÐ */
    for(i = 0; i <= 4; i++)
    {
        /* µ±ÐÐÊýΪiʱ£¬¿Õ¸ñÊýÊÇiµÄº¯Êý£¬Îª4-i¸ö */
        for(j = 0; j <= 3-i; j++)
            printf(" ");
        /* ÐǺÅÊýÒ²ÊÇiµÄº¯Êý£¬Îª2i+1¸ö */
        for(k = 0; k <= 2*i; k++)
            printf("*");
        printf("\n");
    }
     
    /* ±äÁ¿i´Ó0µ½3£¬±íʾËù»­ÁâÐÎͼµÄµÚÁùÖÁµÚ¾ÅÐÐ */
    for(i = 0; i <= 3; i++)
    {
        /* µ±ÐÐÊýΪiʱ£¬¿Õ¸ñÊýÊÇiµÄº¯Êý£¬´ËʱΪi¸ö */
        for(j = 0; j <= i; j++)
            printf(" ");
        /* ÐǺÅÊýÒ²ÊÇiµÄº¯Êý£¬´ËʱΪ7-2i¸ö */
        for(k = 0; k <= 6-2*i; k++)
            printf("*");
        printf("\n");
    }
    return 0;
}


Ïà¹ØÎĵµ£º

ADC0809 C³ÌÐò

 #include<reg52.h>
#include<intrins.h>
#define uint  unsigned int
#define uchar unsigned char
uint date;
uchar mm=0,n=0;
uint k1,k2,k3,k4,k5,k6;
uchar code b[]={
    0x3f,0x06,0x5b,0x4f,0x66,   //0,1,2,3,4,
    0x6d,0x7d,0x07,0x7 ......

c#Óëc¡¢javaµÄ¹Øϵ

 C#´ÓJava¼Ì³Ð¶øÀ´µÄÌصã
¡¡¡¡Àà:ÔÚC#ÖÐÀàµÄÉêÃ÷ÓëJavaºÜÏàËÆ.ÕâÊǺÏÀíµÄÒòΪ¾­Ñé¸æËßÎÒÃÇJavaÄ£Ð͹¤×÷µÃºÜºÃ.JavaµÄ¹Ø¼ü×ÖimportÒѾ­±»Ìæ»»³Éusing,ËüÆðµ½ÁËͬÑùµÄ×÷ÓÃ.Ò»¸öÀ࿪ʼִÐеÄÆðµãÊǾ²Ì¬·½·¨Main().ÏÂÃæµÄHello World³ÌÐòչʾÁË»ù±¾µÄÐÎʽ:
¡¡¡¡using System;
¡¡¡¡class Hello
¡¡¡¡{
¡¡¡¡static v ......

C ¶Á100¸öÊýµ½Êý×é

 #include <stdio.h>
#define MAX 100
int a[MAX], b[MAX], count = 0;
void rData()
{ int i;
FILE *fp;
fp = fopen("C:\\100.dat", "r");
for (i=0; i<MAX; i++)
fscanf(fp, "%d,", &a[i]);
fclose(fp);
}
 
void main()
{ int i;
rData();
//printf("Âú×ãÌõ¼þµÄÊý= ......

C/C++ÖеÄÄÚ´æ²¹Æë»úÖÆ

      ÔÚCÓïÑÔÖУ¬½á¹¹ÊÇÒ»ÖÖ¸´ºÏÊý¾ÝÀàÐÍ£¬Æä¹¹³ÉÔªËؼȿÉÒÔÊÇ»ù±¾Êý¾ÝÀàÐÍ£¨Èçint¡¢long¡¢floatµÈ£©µÄ±äÁ¿£¬Ò²¿ÉÒÔÊÇһЩ¸´ºÏÊý¾ÝÀàÐÍ£¨ÈçÊý×é¡¢½á¹¹¡¢ÁªºÏµÈ£©µÄÊý¾Ýµ¥Ôª¡£ÔڽṹÖУ¬±àÒëÆ÷Ϊ½á¹¹µÄÿ¸ö³ÉÔ±°´Æä×ÔÈ»¶Ô½ç£¨alignment£©Ìõ¼þ·ÖÅä¿Õ¼ä¡£¸÷¸ö³ÉÔ±°´ÕÕËüÃDZ»ÉùÃ÷µÄ˳ÐòÔÚÄÚ´æÖÐ˳Ðò´ ......

C_Êý¾ÝÀàÐÍת»»

 Ô´Âë:
# include <stdio.h>
 
int main()
{
    /* ¶¨Òå±äÁ¿²¢¸³³õÖµ */
     int    a = 5;       
    char   c = 'a';   // 'a'µÄASCÂëµÄֵΪ97
    ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ