C好玩,都来玩C
5854
23
[1 楼] siliconworm
[资深泡菜]
09-11-3 17:28
我说的是C语言。。。
希望有一天能自己编出个尼康的CHDK ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
[24 楼] xiafeng205
[泡菜]
09-11-9 20:33
原文由 没点创意 发表 这个确实牛 |
[23 楼] 水和田
[泡菜]
09-11-7 20:25
楼主,我这个编程外行一先都知道你不是玩C的,这很明显是C++ , 与C不同啊。。
还用了C++标准库的函数,这可不行。。不是纯C~ |
[22 楼] 青海牦牛
[资深泡菜]
09-11-7 20:18
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
[21 楼] 没点创意
[泡菜]
09-11-5 15:43
原文由 何汝大大人 发表 相当同意.............. |
[20 楼] 何汝大大人
[泡菜]
09-11-5 14:37
C好玩?
我认为B好玩,大家来玩B。 |
[19 楼] yhzh
[泡菜]
09-11-5 14:25
原文由 siliconworm 发表 C那边有人破解了相机固件,加了点测什么的。500D升级成50D? |
[18 楼] 南船
[泡菜]
09-11-5 13:16
发一段6年前为朋友写的彩票算号代码:
{ try{ All_22->all=false;// 如果更改过要统计的期数就让综合统计启动 All_22->hao1_22=false;//如果更改过要统计的期数就让各号码统计启动 MainForm->ADOTable1->DisableControls(); int count=RichEdit1->Lines->Count;//总期数 int bad=0;//无效期数 for(int cou=0;cou<count+1;cou++) { AnsiString text0=RichEdit1->Lines->Strings[cou],text; //清除字母开始 int len1=text0.Length(); for(int i=1;i<=len1;i++) { AnsiString ch=text0.SubString(i,1);//取本个字符 if(ch==","||ch==":"||ch=="0"||ch=="1"||ch=="2"||ch=="3"||ch=="4" ||ch=="5"||ch=="6"||ch=="7"||ch=="8"||ch=="9") {text=text+ch;} } //清除字母结束 //text=text.Trim(); //去空白符 int qihao=text.LastDelimiter(':'); //取得最后冒号的位置 int lastqihao=text.Pos(':'); //取得第一个冒号的位置与最后一个是否一样,不一样时做废 int xiaoyan=text.Length(); //校验总字符串长度不够长度的将被取消 AnsiString qihao2=text.SubString(1,qihao-1);//取得期数 if(qihao2==""||qihao!=lastqihao||xiaoyan<15){bad=bad+1;continue;} //continue为跳过本次循环到下次循环 else //break为终止循环 return结束本函数 { TLocateOptions Opts;//下面几句判断新旧期数 if(MainForm->ADOTable1->Locate("期数",qihao2,Opts)) {MainForm->ADOTable1->Edit();} else{MainForm->ADOTable1->Insert();} text=text.Delete(1,qihao); //去除期号: int chang=text.Length(); //取总长度 int duohao=10; for(int i=1;i<27;i++) { MainForm->ADOTable1->Fields->Fields->AsString=" "; //这几句将1-27的记录归零 } int danshu=0; //单数个数 int i22=0; for(int s=0;s<7;s++) {nianhao_22[s]=0;}//连号个数用的5个号码数组归零 while(duohao>0) { text=text.Trim(); //去空白符 duohao=text.LastDelimiter(',');//','号的位置 AnsiString zi; //取得的值 zi=text.SubString(duohao+1,chang-duohao);//SubString(int1,int2)为取int1后int2位的值 text=text.Delete(duohao,10);//删除逗号后的字符 if((zi!=""&&qihao2!="")&&(StrToInt(zi)>0&&StrToInt(zi)<23)) { MainForm->ADOTable1->FieldValues["期数"]=qihao2; MainForm->ADOTable1->FieldValues["期号"]=qihao2; MainForm->ADOTable1->FieldValues[StrToInt(zi)]="★"; if((StrToInt(zi)%2)==1){danshu=danshu+1;}//单号个数 MainForm->ADOTable1->FieldValues["单号"]=danshu; i22=i22+1; //for数组nianhao[X] nianhao_22[i22]=StrToInt(zi);//将5个开奖号码赋值给数组 } } nianhao();//计算连号个数自定义函数 还有求和的值与距离 MainForm->ADOTable1->FieldValues["连号"]=nianhao_sum;//连号个数 MainForm->ADOTable1->Post(); //以下是算重号 ........... AnsiString now[22],old[22]; int chong=0; AnsiString chongstr1,chongstr2; TLocateOptions Opts1;//下面几句查期数 if(MainForm->ADOTable1->Locate("期数","0"+IntToStr(StrToInt(qihao2-1)),Opts1)) { chongstr1=MainForm->ADOTable1->FieldValues["期数"]; for(int cc=1;cc<23;cc++) {old[cc]=MainForm->ADOTable1->Fields->Fields[cc]->AsString;} } else { MainForm->ADOTable1->MoveBy(-1); chongstr1=MainForm->ADOTable1->FieldValues["期数"]; for(int cc=1;cc<23;cc++) {old[cc]=MainForm->ADOTable1->Fields->Fields[cc]->AsString;} } TLocateOptions Opts2;//下面几句查期数 if(MainForm->ADOTable1->Locate("期数","0"+IntToStr(StrToInt(qihao2)),Opts2)) { chongstr2=MainForm->ADOTable1->FieldValues["期数"]; for(int c=1;c<23;c++) {now[c]=MainForm->ADOTable1->Fields->Fields[c]->AsString;} } for(int ccc=1;ccc<23;ccc++) { if((old[ccc]==now[ccc])&&(old[ccc]=="★")&&chongstr1!=chongstr2) {chong=chong+1;} } MainForm->ADOTable1->Edit(); MainForm->ADOTable1->FieldValues["重号"]=chong;//得出重号 MainForm->ADOTable1->FieldValues["和"]=he_sum; //和 MainForm->ADOTable1->FieldValues["距离"]=jili;//距离 MainForm->ADOTable1->Post(); //以上是算重号 .................. }//if } //for MainForm->ADOTable1->EnableControls(); Label3->Caption=IntToStr(RichEdit1->Lines->Count-bad+1)+"期";//有效期数 Label5->Caption=IntToStr(bad-1)+"期";//无效期数 }//try catch(...) { suiMessageDialog1->Text="您输入的登记格式不正确!\n请参照:04018:01,04,22,16,08"; suiMessageDialog1->ShowModal(); MainForm->ADOTable1->Delete(); MainForm->ADOTable1->EnableControls(); } } |
[17 楼] cecf
[老坛泡菜]
09-11-5 10:17
原文由 siliconworm 发表 LZ的这个表情符好玩! |
[16 楼] keron
[资深泡菜]
09-11-4 14:37
不说这个也罢,一提起来,寻思了一下,用C语言快15年了...
最近7年基本不再负责具体编码实施,功力估计荒废掉不少 阿弥陀佛 |
[15 楼] yifanker
[资深泡菜]
09-11-4 14:30
我想起来了,CS的AMXX插件各个功能都是由C源码写的
|
[14 楼] 山野如风
[泡菜]
09-11-4 14:03
原文由 带着眼睛旅行 发表 不过是90年前后自己在实验室做了一些试验设备的控制、采集、过程曲线和试验参数显示、最终自动计算试验结果的小玩意。所谓把握,也就是能够编写出满足上述用途的程序,没什么致命BUG而已。2、3万行代码,不能和商业开发的应用比较,有些自娱自乐的味道。 一个很肤浅层次的把握,让您见笑了。 现在也统统忘光了,惭愧的很。 |
[13 楼] 带着眼睛旅行
[泡菜]
09-11-4 13:51
原文由 山野如风 发表 没有做出一个project出来你敢说能说C基本把握,ABC国人都能认识几个,谁就敢说自己懂英语。 [带着眼睛旅行 编辑于 2009-11-04 13:53] |
[12 楼] siliconworm
[资深泡菜]
09-11-3 18:57
原文由 天罡流星腿 发表 貌似这是浏览器的问题 |
[11 楼] siliconworm
[资深泡菜]
09-11-3 18:56
原文由 shoppo0505 发表 哈哈!!!!!!这张图太搞笑了! ![]() |
[10 楼] 天罡流星腿
[泡菜]
09-11-3 18:50
谁能让图里那些个小家伙们挨个儿翻身??
|
[9 楼] shoppo0505
[资深泡菜]
09-11-3 18:44
进阶:
#include "win31.h" #include "win95.h" #include "win98.h" #include "workst~1.h" #include "evenmore.h" #include "oldstuff.h" #include "billrulz.h" #include "monopoly.h" #define INSTALL = HARD char make_prog_look_big[1600000]; void main() { while(!CRASHED) { display_copyright_message(); display_bill_rules_message(); do_nothing_loop(); if (first_time_installation) { make_50_megabyte_swapfile(); do_nothing_loop(); totally_screw_up_HPFS_file_system(); search_and_destroy_the_rest_of_OS/2(); make_futile_attempt_to_damage_Linux(); disable_Netscape(); disable_RealPlayer(); disable_Lotus_Products(); hang_system(); } write_something(anything); display_copyright_message(); do_nothing_loop(); do_some_stuff(); if (still_not_crashed) { display_copyright_message(); do_nothing_loop(); basically_run_windows_3.1(); do_nothing_loop(); do_nothing_loop(); } } if (detect_cache()) disable_cache(); if (fast_cpu()) { set_wait_states(lots); set_mouse(speed, very_slow); set_mouse(action, jumpy); set_mouse(reaction, sometimes); } /* printf("Welcome to Windows 3.1"); */ /* printf("Welcome to Windows 3.11"); */ /* printf("Welcome to Windows 95"); */ /* printf("Welcome to Windows NT 3.0"); */ /* printf("Welcome to Windows 98"); */ /* printf("Welcome to Windows NT 4.0"); */ printf("Welcome to Windows 2000"); if (system_ok()) crash(to_dos_prompt) else system_memory = open("a:\swp0001.swp", O_CREATE); while(something) { sleep(5); get_user_input(); sleep(5); act_on_user_input(); sleep(5); } create_general_protection_fault(); } |
[8 楼] shoppo0505
[资深泡菜]
09-11-3 18:42
公布一下MS的源程序:
![]() |
[7 楼] 帮我弄出来
[资深泡菜]
09-11-3 18:25
靠,你们怎么都那么高的泡网分啊
|
[6 楼] 山野如风
[泡菜]
09-11-3 18:23
当年,DOS时代,自学了几种计算机语言,都是一两周搞定,就是这个C语言,溜溜用了1年才算基本能把握住。
好玩真好玩,难对付也真难对付。 现在十几年不碰了。 |
[5 楼] silvos
[泡菜]
09-11-3 18:19
强贴留名
![]() |
[4 楼] 星城钢少
[资深泡菜]
09-11-3 17:57
![]() |
[3 楼] 阿票
[资深泡菜]
09-11-3 17:37
这贴要顶!
![]() |
[2 楼] siliconworm
[资深泡菜]
09-11-3 17:32
有人试过破解相机固件吗?
附:首贴那段程序的源代码: [code] #include<iostream.h> #include<fstream.h> #include <conio.h> void main() { ofstream outfile("data.txt"); int i=1,j; while(i<=20) { j=1; while(j<i&&j<=20-i) { cout<<" "; outfile<<" "; j++; } cout<<" ![]() outfile<<" ![]() while(j>=20-i&&j<i) { cout<<" "; outfile<<" "; j++; } cout<<" "; outfile<<" "; while(j<=20-i) { cout<<" "; outfile<<" "; j++; } i++; cout<<" ![]() outfile<<" ![]() } } [/code] |