Click here to Skip to main content
15,914,289 members
Home / Discussions / C#
   

C#

 
Questiontimer loop from vb5 Pin
donkaiser20-Jun-06 4:48
donkaiser20-Jun-06 4:48 
AnswerRe: timer loop from vb5 [modified] Pin
led mike20-Jun-06 5:15
led mike20-Jun-06 5:15 
Questiondynamic control Pin
abhaygalande20-Jun-06 4:28
abhaygalande20-Jun-06 4:28 
AnswerRe: dynamic control Pin
Josh Smith20-Jun-06 4:59
Josh Smith20-Jun-06 4:59 
QuestionGet values from a Listview [modified] Pin
Willem_Le_Roux20-Jun-06 3:43
Willem_Le_Roux20-Jun-06 3:43 
AnswerRe: Get values from a Listview Pin
Drew McGhie20-Jun-06 4:19
Drew McGhie20-Jun-06 4:19 
AnswerRe: Get values from a Listview Pin
Josh Smith20-Jun-06 4:30
Josh Smith20-Jun-06 4:30 
GeneralRe: Get values from a Listview [modified] Pin
Willem_Le_Roux20-Jun-06 23:02
Willem_Le_Roux20-Jun-06 23:02 
Questionlist files in directory ordered by creation time Pin
valiovalio20-Jun-06 3:29
valiovalio20-Jun-06 3:29 
AnswerRe: list files in directory ordered by creation time Pin
Guffa20-Jun-06 3:42
Guffa20-Jun-06 3:42 
QuestionHow to delete word document [modified] Pin
ayyp20-Jun-06 2:48
ayyp20-Jun-06 2:48 
Questionc# Brain teaser Pin
izakfick20-Jun-06 2:47
izakfick20-Jun-06 2:47 
AnswerRe: c# Brain teaser Pin
Wjousts20-Jun-06 3:05
Wjousts20-Jun-06 3:05 
AnswerRe: c# Brain teaser Pin
J4amieC20-Jun-06 3:07
J4amieC20-Jun-06 3:07 
GeneralRe: c# Brain teaser Pin
izakfick20-Jun-06 3:17
izakfick20-Jun-06 3:17 
GeneralRe: c# Brain teaser Pin
thelastjedi20-Jun-06 3:23
thelastjedi20-Jun-06 3:23 
GeneralRe: c# Brain teaser Pin
izakfick20-Jun-06 3:31
izakfick20-Jun-06 3:31 
AnswerRe: c# Brain teaser Pin
thelastjedi20-Jun-06 3:36
thelastjedi20-Jun-06 3:36 
GeneralRe: c# Brain teaser Pin
izakfick20-Jun-06 3:42
izakfick20-Jun-06 3:42 
GeneralRe: c# Brain teaser Pin
izakfick20-Jun-06 3:43
izakfick20-Jun-06 3:43 
GeneralRe: c# Brain teaser Pin
thelastjedi20-Jun-06 4:08
thelastjedi20-Jun-06 4:08 
GeneralRe: c# Brain teaser Pin
izakfick20-Jun-06 4:10
izakfick20-Jun-06 4:10 
AnswerRe: c# Brain teaser Pin
thelastjedi20-Jun-06 4:38
thelastjedi20-Jun-06 4:38 
using System;

namespace ConsoleApplication2
{
///
/// Summary description for Class1.
///

class Class1
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
Calculate c = new Calculate();

c.initCalc();
System.Console.WriteLine ("Done");
System.Console.Read ();
}
}
public class Calculate
{

int[] intArray = {1,2,3,4,5,6,7,8,9};

public void initCalc()
{
string s_out = "";
int iTotal = 0;
int j=0;
for(int i = 0; i < intArray.Length; i++)
{
iTotal = intArray[i];
s_out = intArray[i].ToString() + " + ";
j=i;
calc(intArray, j, s_out, iTotal);
}
}

public string calc(int[] intArray, int j, string s_out, int iTotal)
{
String s_out2;
if(iTotal == 10)
{
s_out = s_out.Substring(0,s_out.LastIndexOf("+")-1) + " = " + iTotal.ToString();
Console.WriteLine(s_out);
}

while(iTotal < 10 && j<intarray.length)
{
="" itotal="iTotal" +="" intarray[j];
="" s_out2="s_out;
" s_out="s_out" intarray[j].tostring()="" "="" ";
="" calc(intarray,j,s_out,="" itotal);
="" -="" j++;
="" }
="" if(itotal="">10)
{
s_out = "";
}
return s_out;
}
}

}


Jedi
GeneralRe: c# Brain teaser Pin
izakfick20-Jun-06 4:49
izakfick20-Jun-06 4:49 
GeneralRe: c# Brain teaser Pin
thelastjedi20-Jun-06 5:07
thelastjedi20-Jun-06 5:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.