Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //function
- #include<stdio.h>
- void get1(int x);
- int main()
- {
- int y;
- while(1){
- scanf("%d",&y);
- get1(y);
- }
- }
- void get1(int x)
- {
- int i;
- if(x>0){
- for(i=1;i<=x;i++){
- printf("+");
- }
- }
- else if(x<0){
- for(i=0;i>x;i--){
- printf("-");
- }
- }
- printf("\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement