Profile cover photo
Profile photo
Victor Zhong
King Bob :)
King Bob :)
About
Victor's posts

Post has attachment
猜拳
#include <stdio.h>
float a=0;
int u;
void win();
void lose();
void save();
int main()
{
   printf("請出拳(剪刀:1  石頭:2  布:3):");
   scanf("%d",&u);
   a=(rand()%3)+1;
   printf("玩家出的是:");
   if(u==1){printf("剪刀\n");}
   if(u==2){printf("石頭\n");}
   if(u==3){prin...

Post has attachment

Post has attachment
字串
int main() {    char str[15]="0123456789";    printf("str=%s \n",str);    strcpy(str,"hello 一三五");    printf("str=%s \n",str);    printf("請輸入ID:");    gets(str);    puts(str);    puts("骯骯! \n");      /--/    char name[5][30],temp[30];    int i,j;    for...

Post has attachment
二維陣列2
int main()
{
   int i,j,k,num[2][20];
   int stu[8][3]={
       {67,90,80},
       {73,65,80},
       {44,85,75},
       {84,82,48},
       {82,75,68},
       {45,98,40},
       {61,46,55},
       {79,90,75}};
   int avg[8];
   for(i=0;i<=19;i++)
   {
     ...

Post has attachment
陣列資料整理
#include <stdio.h>
#include<stdlib.h>
int main()
{
 
 
   int AA[]={};
   int size=0;
   int temp,i,j,a;
   /----/
      printf("請輸入資料數量:");
      scanf("%d",&size);
      for (i=0;i<size;i++)
      {
            printf("請輸入第%d筆資料:",i+1);
            ...

Post has attachment
陣列比較大小
#include <stdio.h>
#include<stdlib.h>
main()
{
   int A[100],i=0;
   printf("Address67=%d \n",&A[67]);
   while(i>=0&&i<=100)
   {
      printf("請輸入需要查詢的基址:");
      scanf("%d",&i);
      printf("Address%d=%d \n",i,&A[i]);
   }
   system("cls");
   int B[5]...

Post has attachment
**
main() {    int i,k=0,a=10,b=60,A[a]; //a=人數 b=及格標準    int up=0,down=0;    for(i=1;i<=a;i++)    {       printf("請輸入%d號的分數:",i);       scanf("%d",&A[i]);    }    system("CLS");    for(i=1;i<=a;i++)    {       printf("%d號分數:%d分\n",i,A[i]);    }    for(i=1;i<=...

Post has attachment
超商系統2 (部分完善)
main() { int a,b,c,d,e,f,j,z,x,i=1,sum=0; start: printf("╭================╮\n"); printf("|| Yahoo 拍賣平台 ||\n"); printf("||================||\n"); printf("||(1) 3C電腦產品 ||\n"); printf("||(2)手機 10000元 ||\n",d=10000); printf("||(3)男裝 3000元 ||\n",e=3000); print...

Post has attachment
副程式2
int x_add_y(int x,int y) {    return(x+y); } int toa(int a) {    int i,sum=0;    for(i=1;i<=a;i++)    {       sum+=i;    }    return(sum); } int b_to_c(int b,int c) {    int sum=1,i;    for(i=0;i<c;i++)    {       sum*=b;    }      return(sum); } int main (...
Wait while more posts are being loaded