ぼるじょあがC/C++の宿題を片づけますYO! 47代目
■ このスレッドは過去ログ倉庫に格納されています
0381デフォルトの名無しさん
2005/07/08(金) 23:53:54#include <stdio.h>
/* 1 */
struct stdata { int no, char name[11]; int score[5];}
/* 2 */
struct stdata g_data1[10];
int set_data(int index, int no, char *name, int score[4])
{
if( index < 0 || index > 11) return 0;
else
{
struct stdata *p = g_data[index];
p->no = no;
strncopy(p->name, name, 10);
memmove(p->score+1, score, sizeof(int)*4);
return 1;
}
}
/* 3 */
void goukei(struct stdata *astdata)
{
if( astdata != NULL )
{
int i;
astdata->score[0] = 0; /* score[0] に合計点 */
for(i = 0; i < 4; ++i) astdata->score[0] += astdata->score[i];
}
}
■ このスレッドは過去ログ倉庫に格納されています