长路


私信TA

用户名:939974883

访问量:10659

签 名:

939974883

等  级
排  名 1419
经  验 2793
参赛次数 1
文章发表 14
年  龄 18
在职情况 学生
学  校 苏州市职业大学
专  业 计算机应用技术

  自我简介:

大一新生,专业计算机应用技术

 

0.0分

89 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区

#include <stdio.h>
int main()
{
    int i, n, temp, t;
    scanf("%d", &n);
    int a[n ];
    for (i = 1; i <= n; i++)
    {
        if (i % 3 == 0)
        {
            temp = i;
        }
    }
    if (temp = n)
    {
        temp -= 1;
    }else
    if (n%temp==1)
    {
        temp = n;
    }
    printf("%d", temp);

    return 0;
}
为啥这个只有50分彦祖们帮忙看下
2023-12-13 13:09:43
#include <stdio.h>
int main()
{
	int a,b,c=0;
	int sz[50];
	scanf("%d",&a);
	for(b=0; b<a; b++){
		sz[b]=b+1;
	}
	int d=a;
	while(d>1){
		for(b=0; b<a; b++){
			if(sz[b]!=0){
				c++;
				if(c==3){
					sz[b]=0;
					c=0;
					d--;
				}
			}
		}
	}
	for(b=0; b<a; b++){
		if(sz[b]!=0)
			printf("%d",sz[b]);
	}
	return 0;
}
2023-08-14 22:35:50
#include<stdio.h>
int main()
{
    int a,e=0,f;
    scanf("%d", &a);
    int c = 1, b[100], i,d;
    for (i = 0; i < a; i++)
    {
        b[i] = i+1;
    }
    i = 0;
    while (e!=1)
    {
        e = 0;
        d = i % a;
        if (c != 3 && b[d] != -1) c++;
        else if (c == 3&&b[d]!=-1)
        {
            b[d] = -1, c = 1; 
        }
        for (f = 0; f < a; f++)
        {
            if (b[f] != -1) e++;
        }
        i++;
    }
    for (i = 0; i < a; i++)
    {
        if (b[i] != -1) { printf("%d", b[i]); break; }
    }
    return 0;
}
2023-07-13 18:16:33
大师,我悟了
2022-12-20 17:51:57
为什么第一个数组的方法可以int a[n],这个n不是变量吗,而且我的devc++还能编译运行????
2022-12-01 14:54:09
current为什么要等于-1,为什么不能直接让它等于0后面current=current%n?
2022-08-29 13:22:30
链表这里我有个问题,按照我的理解,Node和*List都是结构体的别名,那么头节点Node *t = (Node *)malloc(sizeof(Node));   是不是等同于List t = (List)malloc(sizeof(Node));   呢
2022-06-15 15:14:49
#include<stdio.h>
int main(){
	int a[50];
	int i;
	int allNum=0,restNum=0,count=0,roundcount=0;
	scanf("%d",&allNum);
	for(i=0;i<=allNum;i++){
		a[i] = i + 1; // 1 2 3 put into;
	}
	restNum = allNum; 
	
	while(restNum > 1){
		roundcount = 0;
		//遍历数组;
		while(roundcount < allNum){
			if(a[roundcount]!=0){
				count++;
				//报数报到3 就给标记一下,然后就restNum 减少人数
				if(count==3){
					a[roundcount] = 0; // 退出的人标记为0
					restNum--;
					count=0;
				}
			}
			roundcount++;
		}
	}
	for(i=0;i<allNum;i++){
				if(a[i]!=0){
					printf("%d",a[i]);
					break;//直接结束吧; 输出一个
				}
			}
	return 0;//正常退出程序;
}
2022-05-21 20:15:17
  • «
  • 1
  • »