Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit 33c9cd6

Browse files
committed
C# Intermediate | 305 - Balancing My Spending
1 parent 36a2e1c commit 33c9cd6

File tree

9 files changed

+155
-0
lines changed

9 files changed

+155
-0
lines changed

C#/Intermediate/.vs/305 - Balancing My Spending/v15/Server/sqlite3/db.lock

Whitespace-only changes.
600 KB
Binary file not shown.

C#/Intermediate/305 - Balancing My Spending/.vs/305 - Balancing My Spending/v15/Server/sqlite3/db.lock

Whitespace-only changes.
440 KB
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27130.2010
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "305 - Balancing My Spending", "305 - Balancing My Spending\305 - Balancing My Spending.csproj", "{D7D9BF7B-DDE3-46D3-9D22-602CD23CBA16}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{D7D9BF7B-DDE3-46D3-9D22-602CD23CBA16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{D7D9BF7B-DDE3-46D3-9D22-602CD23CBA16}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{D7D9BF7B-DDE3-46D3-9D22-602CD23CBA16}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{D7D9BF7B-DDE3-46D3-9D22-602CD23CBA16}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {E23B0F6B-0F2F-4755-A1A4-2A885A8F87E6}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{D7D9BF7B-DDE3-46D3-9D22-602CD23CBA16}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>_305___Balancing_My_Spending</RootNamespace>
10+
<AssemblyName>305 - Balancing My Spending</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="System.Core" />
37+
<Reference Include="System.Xml.Linq" />
38+
<Reference Include="System.Data.DataSetExtensions" />
39+
<Reference Include="Microsoft.CSharp" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Net.Http" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="Program.cs" />
46+
<Compile Include="Properties\AssemblyInfo.cs" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<None Include="App.config" />
50+
</ItemGroup>
51+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
52+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
5+
class Program {
6+
7+
public static List<int> debts;
8+
public static int amount;
9+
10+
static void Main() {
11+
12+
Console.Write("Enter number of transactions: ");
13+
amount = Convert.ToInt32(Console.ReadLine());
14+
15+
Console.Write("Enter transactions: ");
16+
try {
17+
debts = Console.ReadLine().Split().Select(x => Convert.ToInt32(x)).ToList();
18+
} catch (Exception) {
19+
Console.WriteLine("no");
20+
Environment.Exit(-1);
21+
}
22+
23+
Console.Write("Result: ");
24+
for (int i = 0; i <= debts.Count - 1; i++) {
25+
if (i == 0) {
26+
if (debts.Take(1).Sum() == debts.Skip(1).Sum()) {
27+
Console.Write(string.Format("0 "));
28+
}
29+
} else if (debts.Take(i).Sum() == debts.Skip(i + 1).Sum()) {
30+
Console.Write(string.Format("{0} ", i));
31+
}
32+
}
33+
Console.ReadKey();
34+
Environment.Exit(0);
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("305 - Balancing My Spending")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("305 - Balancing My Spending")]
13+
[assembly: AssemblyCopyright("Copyright © 2018")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("d7d9bf7b-dde3-46d3-9d22-602cd23cba16")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)