記事一覧
英字の出現回数
#include <stdio.h>#include <ctype.h>int main(int argc, char *argv[]){ int c[128]; //回数記録用 int ch; //文字読み込み用 for(ch= 0;ch!=128; ch…
N竜の配置
#include <stdio.h>#include <stdlib.h>//------------------------------------------------#define N 12 //盤面int brd[N][N]; //12*12int flg[N]; //配置済みin…
漸化式・再帰・動的計画法
#include <stdio.h>#include <stdlib.h> //atoi#include <time.h> //実行時間計測clock_t#define none (-1) //既出解判定用long int f(int n); //既出解記録…
再帰的構文
#include <stdio.h>#include <string.h> //strlen//--------------------------------------------int A(char ch); //定義判定関数//----------------------------…
曜日の特定日
#include <stdio.h>#include <stdlib.h>#include <time.h>int dayofweek(int year, int month, int day){ struct tm t; t.tm_year = year -1900; //年 1900~ t.tm_mo…
カレンダー
#include <stdio.h>#include <time.h>#include <stdlib.h>int main(int argc, char *argv[]){ char mday[12]= {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; …
ネイピア
#include <stdio.h>#include <stdlib.h> //atoi#define L 8000#define N 4000int i, k;int c;void sp(int a[], int b, int c[]);void ad(int d[], int e[], int f[]);void …
1位は誰
#include <stdio.h>typedef struct{ char ftname[50]; char ltname[50]; int scr;}player;int main(int argc, char* argv[]){ int i; int c= 0; int hiscr=…
最大三角形
#include <stdio.h>#include <math.h>int main(int argc, char *argv[]){ float a, b, c, s, S, m; int i, j; //行番号カウンタ for(i=1; scanf("%f %f %f",&a, &…