马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #include<stdio.h>
- int main(){
- printf("hello world!");
- return 0;
- }
复制代码
- #include<stdio.h>
- int main(){
- int a,b,sum,quotient;
- printf("Enter two numbers:");
- scanf("%d %d",&a,&b);
- sum = a + b;
- quotient = a / b;
- printf("%d + %d = %d\n",a,b,sum);
- if(b != 0){
- printf("%d / %d = %d",a,b,quotient);
- }
- else{
- printf("请检查你输入的数字是否正确。");
- }
- return 0;
- }
复制代码
- #include<stdio.h>
- int main(){
- int number;
- printf("Enter a number:");
- scanf("%d",&number);
- if(number%2 == 0){
- printf("%d is even",number);
- }
- else{
- printf("%d is odd",number);
- }
- return 0;
- }
复制代码
- #include<stdio.h>
- int main(){
- int year;
- printf("Enter a year:");
- scanf("%d",&year);
- if(year % 4 == 0 & year % 100 != 0 | year % 400 == 0){
- printf("%d is a leap year",year);
- }
- else{
- printf("%d is not a leap year",year);
- }
- }
复制代码
- #include<stdio.h>
- int main(){
- int n,i;
- int t = 1;
- printf("Enter a number:");
- scanf("%d",&n);
- for(i = 1;i <= n;i++){
- t = t * i;
- }
- printf("factorial = %d",t);
- return 0;
- }
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |