Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
C
yanghui triangle
yanghui triangle
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
winfield301@gmail.com
#1
yanghui triangle
Mar 25 '06, 07:45 AM
how to print the follow one:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
............... ..........
Vladimir S. Oka
#2
Mar 25 '06, 07:55 AM
Re: yanghui triangle
winfield301@gma il.com
opined:
[color=blue]
> how to print the follow one:
> 1
> 1 1
> 1 2 1
> 1 3 3 1
> 1 4 6 4 1
> 1 5 10 10 5 1
> ............... .........[/color]
In ISO Standard C, it's fairly easy:
#include <stdio.h>
int main(void)
{
printf("1\n");
printf("1 1\n");
printf("1 2 1\n");
printf("1 3 3 1\n");
printf("1 4 6 4 1\n");
printf("1 5 10 10 5 1\n);
printf("....... ............... ..\n");
return 0;
}
Or did you mean algorithmically ? In which case:
- this is a wrong group, try comp.programmin g
- a fee is chargeable for doing homeworks
--
BR, Vladimir
I guess I've been wrong all my life, but so have billions of
other people... Certainty is just an emotion.
-- Hal Clement
Comment
Post
Cancel
santosh
#3
Mar 25 '06, 07:55 AM
Re: yanghui triangle
winfield301@gma il.com
wrote:[color=blue]
> how to print the follow one:
> 1
> 1 1
> 1 2 1
> 1 3 3 1
> 1 4 6 4 1
> 1 5 10 10 5 1
> ............... .........[/color]
printf("1\n1\t1 \n1\t2\t1\n1\t3 \t3\t1\n1\t4\t6 \t4\t1\n1\t5\t1 0\t10\t5\t1\n") ;
Comment
Post
Cancel
Vladimir S. Oka
#4
Mar 25 '06, 08:05 AM
Re: yanghui triangle
santosh opined:
[color=blue]
>
winfield301@gma il.com
wrote:[color=green]
>> how to print the follow one:
>> 1
>> 1 1
>> 1 2 1
>> 1 3 3 1
>> 1 4 6 4 1
>> 1 5 10 10 5 1
>> ............... .........[/color]
>
>[/color]
printf("1\n1\t1 \n1\t2\t1\n1\t3 \t3\t1\n1\t4\t6 \t4\t1\n1\t5\t1 0\t10\t5\t1\n") ;
Sorry, this does not work as OP wants. Mind the spacing. ;-)
--
BR, Vladimir
OCCAM'S ERASER:
The philosophical principle that even the simplest
solution is bound to have something wrong with it.
Comment
Post
Cancel
santosh
#5
Mar 25 '06, 08:55 AM
Re: yanghui triangle
Vladimir S. Oka wrote:[color=blue]
> santosh opined:
>[color=green]
> >
winfield301@gma il.com
wrote:[color=darkred]
> >> how to print the follow one:
> >> 1
> >> 1 1
> >> 1 2 1
> >> 1 3 3 1
> >> 1 4 6 4 1
> >> 1 5 10 10 5 1
> >> ............... .........[/color]
> >
> >[/color]
> printf("1\n1\t1 \n1\t2\t1\n1\t3 \t3\t1\n1\t4\t6 \t4\t1\n1\t5\t1 0\t10\t5\t1\n") ;
>
> Sorry, this does not work as OP wants. Mind the spacing. ;-)[/color]
You're right. Didn't read close enough.
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment