2013.11.25 2013.11.25

  #include<stdio.h>

#include<stdlib.h>
 
int main()
{
int a[10]={10,20,30,40,50,60,70,80,90,100};
int t;
for(t=0;t<10;t++)
{
printf("a[%d]的值=%d\n",t,a[t]);
printf("a[%d]的位址=%d\n",t,&a[t]);
printf("a[%d]的大小=%d\n",t,sizeof(a[t]));
}
system("pause");
}
作業二 作業二

  #include <stdio.h>

 
#include <stdlib.h>
 
main()
 
{
 int x=20;
 int y=30;
 int z=40;
 
 char a= 'h';
 char b= 'a';
 char c= 'p';
 char d= 'p';
 char e= 'y';
 
    printf("x 的位址 %x \n",&x );
    printf("y 的位址 %x \n",&y );
    printf("z 的位址 %x \n",&z );
 
    printf("x 的值 %x \n",x );
    printf("y 的值 %x \n",y );
    printf("z 的值 %x \n",z );
 
 
    printf("a 的位址 %x \n",&a );
    printf("b 的位址 %x \n",&b );
    printf("c 的位址 %x \n",&c );
    printf("d 的位址 %x \n",&d );
    printf("e 的位址 %x \n",&e );
    
     
    printf("a 的值 %x \n",a );
    printf("b 的值 %x \n",b );
    printf("c 的值 %x \n",c );
    printf("d 的值 %x \n",d );
    printf("e 的值 %x \n",e );
    
    system ("PAUSE");
 
}
 
作業一 作業一

 #include <stdio.h>

#include <stdlib.h>

int main (void)
{
 int f,g,a,d;
 
  f=30;
  g=60;
  a=30;
  d=f+g+a;
 printf("%d\n",d);
 
 system("pause");
 
}