Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdlib.h>
- #include<stdio.h>
- #include<string.h>
- void creare(char a[100])
- {
- int i,actual=0,x;
- char b[1];
- for (i = 0; i < strlen(a); i++)
- {
- b[0] = a[i];
- b[1] = '\0';
- x = atoi(b);
- while (actual < x)
- {
- actual++;
- printf("(");
- }
- while (actual > x)
- {
- actual--;
- printf(")");
- }
- printf("%d", x);
- }
- while (actual > 0)
- {
- actual--;
- printf(")");
- }
- }
- int main()
- {
- int n,s[100],i;
- printf("Dati nr de stringuri: ");
- scanf("%d", &n);
- for (i = 1; i <= n; i++)
- {
- printf("String nou:\n");
- scanf("%s", s);
- printf("\n\n");
- creare(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement