Esempio n. 1
0
void addhour(sceCdCLOCK* time)
{
	time->hour++;
	if(time->hour == 24)
	{
		adddate(time);
		time->hour = 0;
	}
}
Esempio n. 2
0
void
endin_convertf( fields *endin, fields *info, int reftype, param *p, variants *all, int nall )
{
	newstr *d;
	int  i, level, n, process;
	char *newtag, *t;
	for ( i=0; i<endin->nfields; ++i ) {
		/* Ensure that data exists */
		d = &( endin->data[i] );
		if ( !(d->data) || d->len==0 ) continue;
		/*
		 * All refer format tags start with '%'.  If we have one
		 * that doesn't, assume that it comes from endx2xml
		 * and just copy and paste to output
		 */
		t = endin->tag[i].data;
		if ( t[0]!='%' ) {
			fields_add( info, t, d->data, endin->level[i] );
			continue;
		}
		n = process_findoldtag( t, reftype, all, nall );
		if ( n==-1 ) {
			endin_notag( p, t, d->data );
			continue;
		}
		process = ((all[reftype]).tags[n]).processingtype;
		if ( process == ALWAYS ) continue; /* add these later */
		level = ((all[reftype]).tags[n]).level;
		newtag = ((all[reftype]).tags[n]).newstr;
		if ( process==SIMPLE )
			fields_add( info, newtag, d->data, level );
		else if ( process==TYPE )
			addtype( info, d->data, level );
		else if ( process==TITLE )
			title_process( info, newtag, d->data, level );
		else if ( process==PERSON )
			name_add( info, newtag, d->data, level, &(p->asis), 
					&(p->corps) );
		else if ( process==DATE )
			adddate( info, t, newtag,d->data,level);
		else if ( process==PAGES )
			addpage( info, d->data, level );
		else if ( process==SERIALNO )
			addsn( info, d->data, level );
		else if ( process==NOTES )
			addnotes( info, newtag, d->data, level );
		else {
/*				fprintf(stderr,"%s: internal error -- illegal process %d\n", r->progname, process );
*/
		}
	}
}
Esempio n. 3
0
void adddate(Student *stu)    //插入学生记录(其实就是直接添加,之后再统一排序)
{
	char c[20];
	int a;
	int b;
	int j;
	int i;
	for(i=0;i<10000;i++)
	{

while(stu[i].num!=0)
{
	i++;
}

			printf("请输入学号(输入0退出):");	
			scanf("%d",&a);
			if (a==0) break;
	for(j=0;j<10000;j++)
	{
			if (stu[j].num==a) printf("学号重复!");
			if (stu[j].num==a) b=1;
	}
			if (b==1) break;
			stu[i].num=a;
			printf("请输入姓名:");		
			scanf("%s",&c);
		    strcpy(stu[i].name,c);

			printf("请输入性别:");	
			scanf("%s",&stu[i].sex);

			printf("请输入成绩一:");	
			scanf("%d",&stu[i].score[0]);

			printf("请输入成绩二:");	
			scanf("%d",&stu[i].score[1]);

			printf("请输入成绩三:");	
			scanf("%d",&stu[i].score[2]);

			printf("\n");
			stu[i].total=0;

			stu[i].rank=0;
	}

savedate(stu);

	if (b==1) printf("\n");
	if (b==1) adddate(stu);
}
Esempio n. 4
0
void
risin_convertf( fields *risin, fields *info, int reftype, param *p, variants *all, int nall )
{
	newstr *t, *d;
	int process, level, i, n;
	char *newtag;
	for ( i=0; i<risin->nfields; ++i ) {
		t = &( risin->tag[i] );
		d = &( risin->data[i] );
		n = process_findoldtag( t->data, reftype, all, nall );
		if ( n==-1 ) {
			risin_report_notag( p, t->data );
			continue;
		}
		process = ((all[reftype]).tags[n]).processingtype;
		level   = ((all[reftype]).tags[n]).level;
		newtag  = ((all[reftype]).tags[n]).newstr;
		if ( process==SIMPLE )
			fields_add( info, newtag, d->data, level );
		else if ( process==PERSON )
			name_add( info, newtag, d->data, level, &(p->asis), 
					&(p->corps) );
		else if ( process==TITLE )
			title_process( info, newtag, d->data, level );
		else if ( process==DATE )
			adddate( info, newtag, d->data, level );
		else if ( process==SERIALNO )
			addsn( info, d->data, level );
		else if ( process==NOTES )
			notes_add( info, newtag, d, level );
		else { /* do nothing */ }
	}
	/* look for thesis-type hint */
	if ( !strcasecmp( all[reftype].type, "THES" ) ) {
		for ( i=0; i<risin->nfields; ++i ) {
			if ( strcasecmp(risin->tag[i].data, "U1") )
				continue;
			if ( !strcasecmp(risin->data[i].data,"Ph.D. Thesis")||
			     !strcasecmp(risin->data[i].data,"Masters Thesis")||
			     !strcasecmp(risin->data[i].data,"Diploma Thesis")||
			     !strcasecmp(risin->data[i].data,"Doctoral Thesis")||
			     !strcasecmp(risin->data[i].data,"Habilitation Thesis"))
				fields_add( info, "GENRE", risin->data[i].data,
					0 );
		}
	}
}
Esempio n. 5
0
void managebase(Student *stu)    //基本信息管理
{
	int type;
	do
	{
	printf("\n请输入序号选择相应功能\n");
	printf("******** 1.插入学生记录 ********\n");
	printf("******** 2.删除学生记录 ********\n");
	printf("******** 3.修改学生记录 ********\n");
	printf("******** 0.退出         ********\n");
		scanf("%d",&type);
	    switch(type)
		{
		case 0:printf("");break;
		case 1:adddate(stu);break;
		case 2:deldate(stu);break;
		case 3:alterdate(stu);break;
		default:printf("没有该选项,请重输");break;
		}
	}while(type!=0);
}
Esempio n. 6
0
int main(){
	int stline = 0;
	FILE *fil, *fil2;
	while(stline <= 50){
	float today[100][5]; //today[row number][opening], [][closing], [][U], [][D], [][rsi]
	int day = 0, i = 0, n = 15;
	char name[] = "Stocks/01-06-2011.txt";
	char namein[21], note[21];
	int j = 0;
	for(; i < 100  && day < n; i++){
		for(j = 0; j < 21; j++){
			namein[j] = name[j];
			note[j] = name[j];
		}
		namein[0] = 'O'; namein[1] = 'u'; namein[2] = 't'; namein[3] = 'p'; namein[4] = 'u'; namein[5] = 't';
		note[0] = 'N'; note[1] = 'o'; note[2] = 't'; note[3] = 'i'; note[4] = 'c'; note[5] = 'e';
		if(oneday(name, today, day, stline) == 0)
			day++;
//		name[8]++;
		adddate(name);
	}
	fil = fopen(namein, "a");
	fil2 = fopen(note, "a");
	//char date[15];
	//for(j = 0; j < 15; j++){date[j] = namein[j + 6];}
	//fprintf(fil, "%s\n", name);
	today[0][2] == 0; today[0][3] == 0;
	oneday(name, today, day, stline);
	calcrsi(today, n);
	for(i = day - 1; i < day; i++){
		fprintf(fil,"%f\t%f\t%f\t%f\t%f\n", today[i][0], today[i][1], today[i][2], today[i][3], today[i][4]);
		if(today[i][4] <= 30 || today[i][4] >= 70)
			fprintf(fil2, "%d\t%f\n", stline, today[i][4]);
	}
	fprintf(fil,"\n");
	stline++;
	}
}