#include<stdio.h>
void main()
{
int cats,dogs,others,total_pets;
cats=10;
dogs=43;
others=36;
total_pets=cats+dogs;
printf("there are %c total pets are",total_pets);
}
Run Code Online (Sandbox Code Playgroud) 这是我的代码:
#include<stdio.h>
#include<stdlib.h>
void main()
{
int n,i,a[40];
char file_name[100];
FILE *file;
printf("enter the file name\n");
scanf("%s",&file_name);
printf("enter the size\n");
scanf("%d",&n);
if((file=fopen(file_name,"rb"))==NULL)
{
printf("cant open a file\n");
return;
}
fread(a,sizeof(int),n,file);
for(i=0;i<n;i++)
{
printf("%s",a[i]);
}
}
Run Code Online (Sandbox Code Playgroud) #define swap(a,b,c)(int t;t=a;a=b;b=t;);
void main()
{
int x=10,y=20;
swap (x,y,int);
printf("%d %d\n",x,y);
}
Run Code Online (Sandbox Code Playgroud)
什么是输出,为什么?