Skip to content

Instantly share code, notes, and snippets.

View Collonville's full-sized avatar
🍻
Happy beer!!!! Wow!!!!!!

Collonville Collonville

🍻
Happy beer!!!! Wow!!!!!!
View GitHub Profile
/*
* 学籍番号・氏名:153354 舘山北斗
* 授業回・課題番号:第6回・第2課題
* 工夫した点:BM法を利用して高速化を行った
*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<time.h>
SELECT name FROM meal WHERE price < 1000
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
List<int> boo = new List<int>(); //new list
foreach (var data in foo)
{
if (data >= 5)
{
boo.Add(data);
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Where(x => x >= 5); //LINQ
foreach (var data in boo)
{
System.Console.WriteLine(data);
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Where(x => x >= 5); //LINQ
boo.ToList().ForEach(x => Console.WriteLine(x)); //show
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Select(x => x * x); //power
boo.ToList().ForEach(x => Console.WriteLine(x)); //show
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Where(x => x % 2 == 0); //get even num
boo.ToList().ForEach(x => Console.WriteLine(x)); //show
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var boo = foo.Where(x => x % 2 == 0 && x < 5); //get even num and is under 5
boo.ToList().ForEach(x => Console.WriteLine(x)); //show
}
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
Console.WriteLine(foo.Count()); // show size
}
class Program
{
static void Main(string[] args)
{
List<Player> foo = new List<Player>
{
new Player(100, "Miku"),
new Player(350, "Ren"),
new Player(700, "Yukarin"),
new Player(3500, "IA")