'Geldscheinprüfer' ändern

master
Peter Ostmann 8 years ago
parent 91da9d3df1
commit 5e19f1c29a

@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication9 namespace ConsoleApplication9
{ {
@ -28,32 +24,18 @@ namespace ConsoleApplication9
int positionszahl = (int)seriennummerChar[0] - 64; int positionszahl = (int)seriennummerChar[0] - 64;
int q1 = QuerSumme(positionszahl); int q1 = QuerSumme(positionszahl);
int q2 = 0;
Console.WriteLine(Convert.ToString(q1)); for (int i = 1; i <= 10; i++) {
Console.WriteLine(Convert.ToString(q2 + "\r\n"));
string snqs = new string(seriennummerChar); q2 += ((int)seriennummerChar[i]-48);
Console.WriteLine(snqs + "\r\n");
int quersumme = 0;
Console.WriteLine(Convert.ToString(seriennummerChar[0] + "!!!! \r\n"));
for (int i = 0; i <= 10; i++)
{
Console.WriteLine(seriennummerChar[i] + "\r\n \r\n");
quersumme += Convert.ToInt32(seriennummerChar[i]);
Console.WriteLine(Convert.ToString(quersumme));
} }
int quersumme = (int)q1 + (int)q2;
//int subtrahend = (quersumme % 9); int subtrahend = (quersumme % 9);
//int result = 8 - subtrahend; int result = 8 - subtrahend;
//if (result == 0) result = 9; if (result == 0) result = 9;
return positionszahl; return result;
} }
} }

Loading…
Cancel
Save