#include <stdio.h>
//本程序演示了用二维数组来输出一个9行9列的杨辉三角
int main(void)
{
int n=9;
int yhsj[9][9];
int i,j;
/////为二维数组赋初值
for(i=0;i<n;i++)
for(j=0;j<n;j++)
{
yhsj[i][j]=0;
......................
阅读全部 | 2013年1月1日 13:39
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//程序目的:模拟抛硬币,看一下正面朝上反面朝上的概率都多大
int main(void)
{
srand((unsigned)time(NULL));
int top=0;
int below=0;
int tmp=0;
for(int i=0;i<100;i++)
{
......................
阅读全部 | 2013年1月1日 07:03
#include <stdio.h>
int main()
{
int test[]={1,1,2,3,4,5,7,8,9,6,10,12,14,13,15,16,17,19,11};
int i=0,j=0,tmp=0;
int len=sizeof test/sizeof(int);
for(i=0;i<len;i++)
{
for(j=i+1;j<len;j++)
{
if(test[i]>=test[j])
......................
阅读全部 | 2012年12月31日 09:22
http://aodag.imust.cn/acmhome/welcome.do;jsessionid=A1FD00EC0D9CF2539AE684B6FF81380F?method=index
阅读全部 | 2012年12月25日 16:25
#include "stdio.h"
#include "windows.h"
#define MEM_LIMIT 4096*1000
int main(int argc, char* argv[])
{
HANDLE hjob;
char *job_name="J1",*pro_name="notepad";
int err;
JOBOBJECT_EXTENDED_LIMIT_INFORMATION joeli;
JOBOBJECT_BASIC_LIMIT_INFORMATION jbii={0};
STARTUPINFOA si ={sizeof(si)};
PROCESS_INFORMATION pi;
......................
阅读全部 | 2012年12月25日 09:10
#include<stdio.h>
#include<windows.h>
bool _closecomputer(int flag)
{
//以下代码主要功能就是提权
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
if (!OpenProcessToken(GetCurrentProcess() ,TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY ,&hToken))
{
return false;
}
if ( !LookupPrivilegeValue( NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid ) )
......................
阅读全部 | 2012年12月24日 23:43
chcp 修改代码页
chcp 437 8*8 等宽等高字体
阅读全部 | 2012年12月24日 08:11
#include<stdio.h>
#include<math.h>
const int N=40;
int main(void)
{
int x,y;
for(x=0;x<N;x++)
{
for(y=0;y<N;y++)
{
if((x==y)||(x+y==(N-1))||(x==0)||(x==(N-1))||(y==0)||(y==(N-1))) printf("*");
else printf(" ");
......................
阅读全部 | 2012年12月23日 07:42
#include <stdio.h>
#include <string.h>
const int MAX=256;
//应用指针统计一个字符串中有多少个单词
int main()
{
char* nums[]={ "one" , "two" , "tree" , "four" , "five"\
, "six" , "seven" , "eight" , "nine" , "ten" };
char word[MAX]={'\0'};
char* test="This is a test number of words in the sentences.";
......................
阅读全部 | 2012年12月20日 20:48
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
void foo( int n )
{
assert( n>0 && n<80 && n%2==1 );
for( int i=0; i<n; ++i )
{
printf( "%*.*s\n", n-abs(i-n/2), n-2*abs(i-n/2), "*******************************************************************************" );
}
}
......................
阅读全部 | 2012年12月20日 15:25