c言語 練習ソースプログラム

[ リスト ]

以下のソース結果をファイルへ出力するための方法を考えます。。。


#include <stdio.h>
#include <string.h>
#define NUM 4
typedef struct{
	int b ;/*学生番号*/
	int s ;/*身長*/
	char k[10];/*結果*/
	}Stdya;

int main (void){
	Stdya std[NUM];
	int i;

	for(i=0;i<NUM;i++){
		printf("学生番号");
		scanf("%d",&std[i].b);
		printf("身長");
		scanf("%d",&std[i].s);
			if(180<=std[i].s)
				strcpy(std[i].k,"tall");
			else
				strcpy(std[i].k," ");			
		printf("%d\t%d\t%s\n",std[i].b,std[i].s,std[i].k);
		
	}


	return 0;
}



以下のソース結果をファイルへ出力するための方法を考えます。。。

閉じる コメント(1)

顔アイコン

月夜はポインタの理解ができていないみたいですっ。一から出直しですがよろしくです!!!

2008/5/16(金) 午後 10:59 月夜


よしもとブログランキング

もっと見る

プライバシー -  利用規約 -  メディアステートメント -  ガイドライン -  順守事項 -  ご意見・ご要望 -  ヘルプ・お問い合わせ

Copyright (C) 2019 Yahoo Japan Corporation. All Rights Reserved.

みんなの更新記事