zoukankan      html  css  js  c++  java
  • PAT_1009(中文)

    题目地址:http://pat.zju.edu.cn/contests/pat-b-practise/1009

     1 #include<stdio.h>
     2 #include<string.h>
     3 
     4 typedef struct{
     5     int start;
     6     int len;
     7 }MARK;
     8 MARK mark[100];
     9 
    10 
    11 int isBlank = 0; 
    12 int len = 0;
    13 int count = 0;
    14 char str[100];
    15 int i = 0;
    16 int j = 0;
    17 int temp;
    18 int main()
    19 {
    20     gets(str);
    21     len = strlen(str);
    22     mark[count].start = 0;
    23     mark[count].len = 0;
    24     for( i = 0; i < len; ++i )
    25     {
    26         if( str[i] != ' ' )
    27         {
    28             ++mark[count].len;
    29         }
    30         else
    31         {
    32             ++count;
    33             mark[count].start = i + 1;
    34             mark[count].len = 0;
    35         }
    36     }
    37     for( i = count; i >= 0; --i )
    38     {
    39         temp = mark[i].start + mark[i].len;
    40         for( j = mark[i].start; j < temp; ++j  )
    41         {
    42             printf("%c", str[j]);
    43         }
    44         if( i != 0 )
    45             printf(" ");        
    46     }
    47     printf("\n");
    48     return 0;
    49 }
  • 相关阅读:
    socket通信原理
    socket通信基础内容
    内核中断过程
    爬虫基础模块
    关于多个运算符的问题
    前戏
    js扩展
    加密
    django之form
    Django
  • 原文地址:https://www.cnblogs.com/shuanghong/p/3024197.html
Copyright © 2011-2022 走看看