竞赛
考级
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; scanf("%d",&a); b=a%10; c=a/10%10; d=a/100%10; e=a/1000%10; f=a/10000%10; printf("%d%d%d%d%d",b,c,d,e,f); return 0; }
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,d,e,c=1,f=1; scanf("%d %d",&a,&b); scanf("%d %d",&d,&e); while(c!=0){ c=a%b; a=b; b=c; } while(f!=0){ f=d%e; d=e; e=f; } printf("%d\n%d",a,d); return 0; }
我和“有兽焉”的小伙伴都在ACGO等你,快用这个专属链接加入我们吧!https://www.acgo.cn/application/1752624769180352512
我和“C++”的小伙伴都在ACGO等你,快用这个专属链接加入我们吧!https://www.acgo.cn/application/1738517918450237440
比赛已结束! ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 赛时说明 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1.第4题#7有误,现将#7的数据公开,以便AK比赛 万分抱歉! AK ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ * 最后提交时间:13:12:39 用户警告 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 以下用户有作弊嫌疑,同时如对结果有异议请联系lan_chance: ID:31****1 疑似抄袭AI生成的代码,已将其踢出排名,现通报! 请其它选手杜绝抄袭行为! 如对比赛有疑问,可以在此帖底下回复 比赛链接 邀请码: XEJ2 前五!(最终排名): ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 排名 ID 得分 参赛者 是否有作弊嫌疑 1 929871 450 Macw07 / 2 4010083 440 坤坤 已扣除10分 T7 3 4039641 320 寤攗鮗囿瓊 / 4 2369314 232 廾匸 / 5 3561366 221 准 / ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 附:疑似抄袭代码( ID:31****1 )
新春欢乐赛的手速奖一共就十个吗?如果一个人拿了两个不发,会给第二名发吗?
太垃了
题目: 我的代码: 全TLE了,肯定因为循环太多次,求在只学到循环嵌套的条件下优化
啊?一会wc一会ac
如果你觉得自己不行了的话就来我没这里点给一个老实本分的垃圾吧,没有人会来笑你
需要带点啥不[doge] @花似雪jacxi
嘶~
兄弟们终于超过%99.80的用户了,好开心,现在是%99.81
#include"role.h" #define LevUp 5 using namespace std; void start_game(); void init_game(); void creatSnake(); void showSnake(); void showFood(); void getKey(); void changeSnake(); void eatFood(); void upScore(); int die(); struct MYsnake{ int x; int y; }; struct Food{ }; struct MYsnake body[100]; struct MYsnake head; struct Food food; int length = 0; int mapX = 50; int mapY = 50; int keyF; int score; int lev = 9; int Flag = 1; int main() { srand(time(0)); start_game(); init_game(); showFood(); creatSnake(); showSnake(); while(true){ getKey(); changeSnake(); showSnake(); eatFood(); upScore(); void upScore(); if(score % LevUp == 0 && score != 0){ if(Flag == 1){ } void start_game() { color(15); gotoxy(12,13); cout <<"★贪 吃 蛇 ★"; gotoxy(12,15); cout<<"输入y开始游戏:"; char c; cin>>c; system("cls"); } void init_game(){ color(15); for(int j = 1; j <=mapX-1; j++){ for(int i = 1;i <= mapY-1; i++){ } void creatSnake() { head.x = rand()%(mapX-1)+1; head.y = rand()%(mapY-1)+1; } void showSnake(){ int i; color(9); } void showFood(){ int i = 0; while(true){ food.x = (rand() % (mapX - 1))+1; food.y = (rand() % (mapY - 1))+1; // gotoxy(0, 80); // cout << food.x << " " << food.y; gotoxy(food.x ,food.y); color(6); cout<<"●"; } void getKey(){ char c; if(kbhit()){ c = getch(); if(c == 'w' || c == 'W'){ keyF = 1; } if(c == 'a' || c == 'A'){ keyF = 2; } if(c == 's' || c == 'S'){ keyF = 3; } if(c == 'd' || c == 'D'){ keyF = 4; } if(c == ' ' ){ keyF = 5; } } } void changeSnake() { struct MYsnake tmp = head; if(keyF == 1) { head.y--; } if(keyF == 2) { head.x--; } if(keyF == 3) { head.y++; } if(keyF == 4) { head.x++; } if(keyF == 5) { } void eatFood(){ if(food.x == head.x && food.y == head.y){ body[length].x = food.x; body[length].y = food.y; length++; Flag = 1; showFood(); } } void upScore(){ score = length; } int die(){ if(head.x == 0 || head.y == 0 ||head.x >= mapX || head.y >= mapY){ return 0; } return 1; }
让我想到了某个像素风冈易游戏
共33445条