| |

VerySource

 Forgot password?
 Register
Search
View: 2602|Reply: 18

Ask about it

[Copy link]

3

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-1-20 10:00:01
| Show all posts |Read mode
Prints out something like
1
twenty one
321
4321
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-28 20:36:01
| Show all posts
You can do this:
#include <iostream>
using namespace std;
int main ()
{
int i;
int j;
for (i = 1; i <= 4; i ++)
{
for (j = i; j> 0; j--)
cout << j;
cout << endl;
}
return 0;
}
Reply

Use magic Report

0

Threads

17

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-1-28 22:27:01
| Show all posts
int main ()
{
for (int i = 1; i <5; ++ i)
{
for (int j = i; j> 0; j--)
cout << j;
cout << endl;
}
Ranch

return 0;
}
Reply

Use magic Report

0

Threads

17

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-1-28 23:00:02
| Show all posts
Wow, I did n’t expect a faster one
Reply

Use magic Report

3

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-1-29 09:09:01
| Show all posts
Didn't say complete, it's my fault. I want to make two codes in C. I don't understand.
sweat!!!
Reply

Use magic Report

0

Threads

45

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-1-29 11:00:01
| Show all posts
Halo changed cout to prinf
Reply

Use magic Report

0

Threads

57

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-2-1 22:18:01
| Show all posts
int main ()
{
  printf ("1");
  printf ("21");
  printf ("321");
  printf ("4321");
  return 0;
}
Reply

Use magic Report

0

Threads

78

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-2-3 16:45:01
| Show all posts
#include <stdio.h>
#include <stdlib.h>

int main ()
{
    int i, j, n;
    printf ("please input a number:");
    scanf ("% d",&n); // Enter 4 here
    
    for (i = 1; i <= n; i ++)
    {
        for (j = i; j> 0; j--)
        printf ("% d", j);
        printf ("\n");
    }

    system ("PAUSE");
    return 0;
}
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 Australia

Post time: 2020-2-4 23:30:01
| Show all posts
Haha, I did not expect a faster
Reply

Use magic Report

0

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-2-9 17:15:01
| Show all posts
Ha ha, is this speed faster?
int main ()
{
printf ("1\n 21\n321\n4321") ;;
return 0;
}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list