请问应该怎么改,输出结果是不对的

编程实现找出字符串中最大字符元素并输出该元素及其对应的ASCII值.
****要求输入提示信息为:
"Input a string:\n"
****输出格式要求为:
"The largest character of "%s" is '%c' ,The ASCII is %d."

程序运行示例:
Input a string:↙
I am a student.
The largest character of "I am a student." is 'u' ,The ASCII is 117.↙
#include<stdio.h>
#include<string.h>
#define N 100
int main()
{
char a[N];
gets(a);
char temp=a[0];
int i;
for(i=0;i!='\0';i++)
{
if(a[i]>temp)
{
temp=a[i];
}

}
printf("The largest character of \"%s\" is \'%c\' ,The ASCII is %d.",a,a[i],a[i]);
return 0;

}

i!='\0' 改为 a[i]!='\0'
printf("The largest character of "%s" is '%c' ,The ASCII is %d.",a,a[i],a[i]);
改为:
printf("The largest character of "%s" is '%c' ,The ASCII is %d.",a,temp,temp);

#include<stdio.h>
#include<string.h>
#define N 100
int main() {
    char a[N];
    gets(a);
    char temp = a[0];
    int i;
    for(i = 0; a[i] != '\0'; i++) {
        if(a[i] > temp) {
            temp = a[i];
        }

    }
    printf("The largest character of \"%s\" is \'%c\' ,The ASCII is %d.", a, temp, temp);
    return 0;
}


#include <stdio.h>
#include <string.h>
#define N 100
int main()
{
    char a[N];
    printf("Input a string:\n");
    gets(a);
    char temp = a[0];
    int i;
    for (i = 0; a[i] != '\0'; i++)
    {
        if (a[i] > temp)
        {
            temp = a[i];
        }
    }
    printf("The largest character of \"%s\" is \'%c\' ,The ASCII is %d.", a, temp, temp);
    return 0;
}

#include<stdio.h>
#include<string.h>
#define N 100
int main()
{
    char a[N];
    gets_s(a);
    char temp = a[0];
    int i;
    for (i = 0; a[i] != '\0'; i++)
    {
        if (a[i] > temp)
        {
            temp = a[i];
        }

    }
    printf("The largest character of \"%s\" is \'%c\' ,The ASCII is %d.", a, temp, temp);
    return 0;
}