Click here to Skip to main content
15,902,636 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to break an infinite loop Pin
Fuseteam19-Sep-15 8:36
Fuseteam19-Sep-15 8:36 
QuestionDefine 'Enter' key in C Pin
Mohamed Nehad18-Sep-15 16:52
Mohamed Nehad18-Sep-15 16:52 
QuestionRe: Define 'Enter' key in C Pin
Richard MacCutchan18-Sep-15 21:44
mveRichard MacCutchan18-Sep-15 21:44 
AnswerRe: Define 'Enter' key in C Pin
Mohamed Nehad20-Sep-15 12:04
Mohamed Nehad20-Sep-15 12:04 
QuestionCall to std::thread::join() in the destructor of a global variable Pin
dchabaud17-Sep-15 3:49
dchabaud17-Sep-15 3:49 
AnswerRe: Call to std::thread::join() in the destructor of a global variable Pin
CPallini17-Sep-15 5:13
mveCPallini17-Sep-15 5:13 
GeneralRe: Call to std::thread::join() in the destructor of a global variable Pin
dchabaud17-Sep-15 5:27
dchabaud17-Sep-15 5:27 
QuestionRe: Call to std::thread::join() in the destructor of a global variable Pin
CPallini17-Sep-15 5:32
mveCPallini17-Sep-15 5:32 
AnswerRe: Call to std::thread::join() in the destructor of a global variable Pin
dchabaud17-Sep-15 20:57
dchabaud17-Sep-15 20:57 
GeneralRe: Call to std::thread::join() in the destructor of a global variable Pin
CPallini17-Sep-15 22:05
mveCPallini17-Sep-15 22:05 
Questionaccess violation with std::map (VS2015) Pin
Member 853403517-Sep-15 3:41
Member 853403517-Sep-15 3:41 
QuestionRe: access violation with std::map (VS2015) Pin
David Crow17-Sep-15 5:06
David Crow17-Sep-15 5:06 
QuestionRe: access violation with std::map (VS2015) Pin
CPallini17-Sep-15 5:09
mveCPallini17-Sep-15 5:09 
QuestionPassing parameters to constructor - very obvious and basic question from an OF Pin
Vaclav_16-Sep-15 11:31
Vaclav_16-Sep-15 11:31 
QuestionRe: Passing parameters to constructor - very obvious and basic question from an OF Pin
CPallini16-Sep-15 21:09
mveCPallini16-Sep-15 21:09 
AnswerRe: Passing parameters to constructor - very obvious and basic question from an OF Pin
Richard MacCutchan16-Sep-15 21:31
mveRichard MacCutchan16-Sep-15 21:31 
GeneralRe: Passing parameters to constructor - very obvious and basic question from an OF Pin
Vaclav_19-Sep-15 1:29
Vaclav_19-Sep-15 1:29 
AnswerRe: Passing parameters to constructor - very obvious and basic question from an OF Pin
Daniel Pfeffer19-Sep-15 21:30
professionalDaniel Pfeffer19-Sep-15 21:30 
QuestionReal time drawing using multithreading Pin
FrankStar8912-Sep-15 23:57
FrankStar8912-Sep-15 23:57 
AnswerRe: Real time drawing using multithreading Pin
jschell13-Sep-15 12:24
jschell13-Sep-15 12:24 
GeneralRe: Real time drawing using multithreading Pin
FrankStar8914-Sep-15 21:48
FrankStar8914-Sep-15 21:48 
GeneralRe: Real time drawing using multithreading Pin
jschell15-Sep-15 11:25
jschell15-Sep-15 11:25 
AnswerRe: Real time drawing using multithreading Pin
David Crow14-Sep-15 4:12
David Crow14-Sep-15 4:12 
GeneralRe: Real time drawing using multithreading Pin
FrankStar8914-Sep-15 21:50
FrankStar8914-Sep-15 21:50 
QuestionNeed help with this little C program Pin
Member 1197963712-Sep-15 12:44
Member 1197963712-Sep-15 12:44 
Hey guys,

I have to write a small program in C, I'll explain what it has to do.

You have product a, b and c

The input is the prices of a, b and c in cents.

You have to spend exactly 100 euros on the purchase of exactly 100 products.

As output I need to get a list of all possible combinations.


Lets give an example. Lets say the input is "88 99 102":
then the output has to be exactly like this:
1 a, 62 b, 37 c
4 a, 48 b, 48 c
7 a, 34 b, 59 c
10 a, 20 b, 70 c
13 a, 6 b, 81 c


I'm relatively new in progamming in C, so all help is appreciated, the deadline is short for this one.

Objective-C
int main(int argc, char *argv[]) {
  int a, b, c, x, y, z /* x=numbers of a y= numbers of b z= numbers of c*/
  printf("price of a:\n");
  printf("price of b:\n");
  printf("price of c:\n");
  scanf("%d, %d, %d" ,&a, &b, &c);
while (x+y+z=100){
x*a+y*b+z*c=10000


As you can see, I tried writing some code, but im stuck right here...

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.