Skip to content

Instantly share code, notes, and snippets.

@matchey
matchey / .bash_aliases
Last active February 15, 2019 07:29
標準出力をシンタックスハイライトする ref: https://qiita.com/matchey/items/a105f39a54760d9e93ef
function vimgitshow(){
git show "$1" | vim -M -c 'set nomod' -c "file ${1##*/}" -c 'filetype detect' -
}

関数

ファイル名は
153Rxxxxxx-05-1.cpp
153Rxxxxxx-05-2.cpp
153Rxxxxxx-05-3.cpp

これらをzipで圧縮 -> 153Rxxxxxx-05.zip

@matchey
matchey / .Draft_cpp
Last active September 18, 2018 02:21
draft_cpp
cppソースの下書きとか お試しとか
@matchey
matchey / 1.cpp
Last active July 18, 2017 08:18
L14_0718 example code
#include <stdio.h>
int pow_ten(int a)
{
if(a<1) return 1;
int rtn = 1;
for(int i=0; i<a; i++){
rtn *= 10;
}
@matchey
matchey / 1.cpp
Last active July 11, 2017 13:53
joho2017 samples
//
//問題1 (20点)
//入力された二つの整数のどちらが大きいか
//を表示するプログラムを作りなさい.
//
//ファイル名を学籍番号10桁-14-1.cppとする.
//
#include<stdio.h>
int main(int argc, char** argv)
@matchey
matchey / 1.cpp
Last active July 18, 2017 08:20
L12_0704 struct and union example code
#include <stdio.h>
#include <math.h>
const int N = pow(10, 4);
struct Point
{
double x;
double y;
double z;
@matchey
matchey / 1.cpp
Last active July 4, 2017 15:28
L11_0627 pointer2 example code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const char* month_db[] = {
"January",
"Feburuary",
"March",
"April",
"May",
@matchey
matchey / 3.cpp
Created June 21, 2017 03:45
L10 pointer
#include <stdio.h>
void input(char str1[], char str2[])
{
printf("文字列入力1:");
scanf("%[^\n]", str1);
printf("文字列入力2:");
scanf(" %[^\n]", str2);
}
@matchey
matchey / 1.cpp
Last active June 21, 2017 05:01
L9_0613 example code
#include <stdio.h>
void print99()
{
for(int i=1; i<10; i++){
for(int j=1; j<10; j++){
if(i*j%2){
printf("[%2d] ", i*j);
}else{
printf(" %2d ", i*j);
@matchey
matchey / 1.cpp
Last active July 4, 2017 15:27
L08_0606 review example code
#include<stdio.h>
int cubic(int x)
{
return x*x*x;
}
int main(void)
{
int x = 0;