Skip to content
Snippets Groups Projects
Commit 3e6a87c4 authored by Axel Ludwig's avatar Axel Ludwig
Browse files

Programm.cs

parent 70d21b41
No related merge requests found
File added
File added
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace P4a
{
class Program
{
static void Main(string[] args)
{
if (args.Length == 3) {
String structure = args [0];
String operation = args [1];
int taille = int.Parse (args [2]);
Random rnd = new Random ();
ICollection<int> li;
switch (operation) {
case "ajout":
if (structure == "liste") {
li = new List<int> ();
} else if (structure == "listeChainee") {
li = new LinkedList<int> ();
} else {
break;
}
for (int i = 0; i < taille; i++) {
li.Add(rnd.Next (0, 10000));
}
Console.WriteLine ("Taille : " + li.Count ());
break;
/////////////
case "acces":
// for (int i = 0; i < taille; i++) {
// li.Add(rnd.Next (0, 10000));
// }
//On remplit la liste
int[] temp = new int[taille];
for (int i = 0; i < taille; i++) {
temp [i] = rnd.Next (0, 10000);
}
if (structure == "liste") {
li = new List<int> (temp);
} else if (structure == "listeChainee") {
li = new LinkedList<int> (temp);
} else {
break;
}
for (int i = 0; i < taille; i++) {
//li[i] = rnd.Next (0, 10000);
li.Contains(rnd.Next (0, 10000));
}
break;
default:
Console.WriteLine ("operation pas reconnue");
break;
}
//Fin du switch operation
}
else { //Si il n'y a pas 3 args
Console.WriteLine ("Arguments : structure operation taille");
}
}
}
}
//switch (structure) {
// case "liste":
// li = new List<int> ();
// Console.WriteLine ("Liste");
// break;
//
// case "listeChainee":
// li = new LinkedList<int> ();
// Console.WriteLine ("Liste Chainée");
// break;
//
// default:
// Console.WriteLine ("Structure pas reconnue");
// li = new List<int> ();
// break;
// }
//Fin du switch structure
\ No newline at end of file
cpuinfo 0 → 100644
This diff is collapsed.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace performance_P4A
namespace P4a
{
class MainClass
class Program
{
public static void Main (string[] args)
{
Console.WriteLine ("Bonjour monde");
static void Main(string[] args)
{
if (args.Length == 3) {
String structure = args [0];
String operation = args [1];
int taille = int.Parse (args [2]);
Random rnd = new Random ();
ICollection<int> li;
switch (operation) {
case "ajout":
if (structure == "liste") {
li = new List<int> ();
} else if (structure == "listeChainee") {
li = new LinkedList<int> ();
} else {
break;
}
for (int i = 0; i < taille; i++) {
li.Add(rnd.Next (0, 10000));
}
Console.WriteLine ("Taille : " + li.Count ());
break;
/////////////
case "acces":
// for (int i = 0; i < taille; i++) {
// li.Add(rnd.Next (0, 10000));
// }
//On remplit la liste
int[] temp = new int[taille];
for (int i = 0; i < taille; i++) {
temp [i] = rnd.Next (0, 10000);
}
if (structure == "liste") {
li = new List<int> (temp);
} else if (structure == "listeChainee") {
li = new LinkedList<int> (temp);
} else {
break;
}
for (int i = 0; i < taille; i++) {
//li[i] = rnd.Next (0, 10000);
li.Contains(rnd.Next (0, 10000));
}
break;
default:
Console.WriteLine ("operation pas reconnue");
break;
}
//Fin du switch operation
}
else { //Si il n'y a pas 3 args
Console.WriteLine ("Arguments : structure operation taille");
}
}
}
}
//switch (structure) {
// case "liste":
// li = new List<int> ();
// Console.WriteLine ("Liste");
// break;
//
// case "listeChainee":
// li = new LinkedList<int> ();
// Console.WriteLine ("Liste Chainée");
// break;
//
// default:
// Console.WriteLine ("Structure pas reconnue");
// li = new List<int> ();
// break;
// }
//Fin du switch structure
\ No newline at end of file
......@@ -19,6 +19,7 @@
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<PlatformTarget>x86</PlatformTarget>
<Commandlineparameters>tableau ajout 10000</Commandlineparameters>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>full</DebugType>
......
#!/bin/bash
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment