1
I have the following problem, in my code I want the program to centrally print the number 1 after the "word", and to center I am using the parameter "%-20s \t"
to try to center the number after the word, but in words with more than one accent, it does not follow the tab.
Follow the source code:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<locale.h>
int main(){
setlocale(LC_ALL, "Portuguese");
int i = 0;
char nomes[3][15];
strcpy(nomes[0], "palavra");
strcpy(nomes[1], "palavrãozzz");
strcpy(nomes[2], "palavrãozão");
for(i = 0; i < 3 ; i++){
printf("%-20s \t1\n", nomes[i]);
}
}
The way out:
[Running] cd "c:\Users\Pierre\Desktop\1\" && gcc *.c -o main && "c:\Users\Pierre\Desktop\1\"main palavra 1 palavrãozzz 1 palavrãozão 1 [Done] exited with code=0 in 0.242 seconds
I wish the way out was:
palavra 1
palavrãozzz 1
palavrãozão 1