---
title: "R-Grade Analysis"
author: "ajinn"
date: "2021-09-16T20:36:30Z"
tags: []
categories: ["非技术"]
slug: "r-grade-analysis"
draft: false
lastmod: "2021-09-16T20:36:30Z"
id: 2521019
url: "https://ajinn.iteye.com/blog/2521019"
---

input &lt;- readLines('stdin')

x &lt;- as.integer(input\[1])

 

data &lt;- data.frame(

    "id" = c(1:10),

    "grade" = c(75, 26, 54, 90, 86, 93, 48, 71, 66, 99)

)

 

y = subset(data, data$grade &gt; x )

print (length(y$grade))

 

=============================

Grade Analysis

 

You have a dataframe that includes grades of students.

Your program needs to take a number as input, and output the number of students who have a grade greater than the given input.

For example, for the input 89, the output should be:

\[1] 3

as 3 students have grades greater than 89.

Hint: You can use the length() function to find the number of items in a vector.