#include <stdio.h>
int main(int argc,char **argv)
{
printf("Hello World!\n");
return 0;
}
int main(int argc,char **argv)
{
printf("Hello World!\n");
return 0;
}
2023-01-31
說的對啊,不論是哪種數(shù)據(jù)類型,都不過是內(nèi)存中的一段二進(jìn)制而已,唯一的區(qū)別就是看你以何種類型去使用罷了
2023-01-06
課程代碼問題不少,continue相關(guān)的代碼想要實現(xiàn)的效果應(yīng)該是依次輸出除了下標(biāo)為10的長度為100的數(shù)組的各個元素,代碼應(yīng)該是if(i == target)而不是if(array[i] == target)。
2023-01-03
void change(int *a, int *b) {
int c = *a;
*a = *b;
*b = c;
}
int fact(int a) {
if (a == 1) {
return 1;
}
else {
return a * fact(a - 1);
}
}
int c = *a;
*a = *b;
*b = c;
}
int fact(int a) {
if (a == 1) {
return 1;
}
else {
return a * fact(a - 1);
}
}
2022-12-07
#include <iostream>
int main(int argc,char** argv)
{
int a=5;
int b=10;
double c = 5.5;
std::cout
<<"a+b="<<a+b
<<"\na-b="<<a-b
<<"\na*b="<<a*b
<<"\na/b="<<double(a)/double(b)
<<"\na+c="<<a+c
<<std::endl;
}
int main(int argc,char** argv)
{
int a=5;
int b=10;
double c = 5.5;
std::cout
<<"a+b="<<a+b
<<"\na-b="<<a-b
<<"\na*b="<<a*b
<<"\na/b="<<double(a)/double(b)
<<"\na+c="<<a+c
<<std::endl;
}
2022-12-05
#include <stdio.h>
#include <iostream>
int main(int argc,char** argv)
{
std::cout<<"char:"<<sizeof(char)
<<"\nshort"<<sizeof(short)
<<"\nint:"<<sizeof(int)
<<"\nlong:"<<sizeof(long)
<<"\nlong long:"<<sizeof(long long)
<<std::endl;
return 0;
}
#include <iostream>
int main(int argc,char** argv)
{
std::cout<<"char:"<<sizeof(char)
<<"\nshort"<<sizeof(short)
<<"\nint:"<<sizeof(int)
<<"\nlong:"<<sizeof(long)
<<"\nlong long:"<<sizeof(long long)
<<std::endl;
return 0;
}
2022-12-05
int add(int a, int b)
{
return a + b;
}
int main(int argc,char **argv)
{
int a = 5;
int b = 10;
int c = add(a + b);//寫錯了吧,應(yīng)該寫成int c = add(a,b);吧
return 0;
}
{
return a + b;
}
int main(int argc,char **argv)
{
int a = 5;
int b = 10;
int c = add(a + b);//寫錯了吧,應(yīng)該寫成int c = add(a,b);吧
return 0;
}
2022-11-21
#inclde<stdio.h>
int main(int argc,char **argv)
{
printf("char:%d\n",sizeof(char));
printf("short:%d\n",sizeof(short));
printf("int:%d\n",sizeof(int));
printf("long:%d\n",sizeof(long));
printf("long long :%d\n",sizeof(long long ));
}
int main(int argc,char **argv)
{
printf("char:%d\n",sizeof(char));
printf("short:%d\n",sizeof(short));
printf("int:%d\n",sizeof(int));
printf("long:%d\n",sizeof(long));
printf("long long :%d\n",sizeof(long long ));
}
2022-11-18